The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Terradev listing page.
Cross-cloud GPU orchestration CLI.

License: Apache 2.0 - Free and open source for commercial and personal use.
Terradev is a cross-cloud compute control plane for AI workloads, not just a provisioning wrapper.
Combines quoting, provisioning, topology optimization, training orchestration, inference tuning, and cost analytics in one CLI, with an accelerated idempotent runtime underneath.
Continued focus on lower cost, faster provisioning, and topology-aware execution with local credential storage.
Model agnostic. Dataset agnostic. GPU agnostic. Provider agnostic. The only thing Terradev is not agnostic about is correctness: it enforces topology, idempotency, and sequencing.
NOTES ON v6.2.4
aws — Amazon Web Servicesazure — Microsoft Azurebaseten — Basetencrusoe — Crusoe Clouddigitalocean — DigitalOceane2enetworks — E2E Networksgcore — Gcoregcp — Google Cloud Platformhuggingface — Hugging Facehyperstack — Hyperstackinferx — InferXlatitude — Latitude.shrunpod — RunPodsiliconflow — SiliconFlowtensordock — TensorDockvastai — Vast.aiyottalabs — YottaLabsgcore) as a new VM provider with full lifecycle support, API token auth, and drift monitoring.configure, setup, quote, credential_prompt, and MCP tool schemas now all reflect the 17-provider set.NOTES ON Multi-Stage Training Pipeline (v6.1.1)
terradev train subcommands for the full post-pretraining lifecycle:
terradev train sft --model <id> --data <path> --nodes <ips>terradev train dpo --base-checkpoint <sft-ckpt> --data <pairs> --algorithm <dpo|simpo|kto|orpo>terradev train grpo --base-checkpoint <dpo-ckpt> --data <prompts> --framework <unsloth|openrlhf|trl>terradev train pipeline --config examples/training_pipeline.yamlterradev_cli/core/training_stages.py and terradev_cli/core/training_pipeline.py provide declarative SFT / DPO / GRPO stage configs, provider-aware quote selection, auto-provisioning, checkpoint handoff, and DAG sequencing via the Python DAGExecutor.TrainingOrchestrator now supports multi-node remote SSH launch and end-to-end completion tracking. Training scripts and embedded configs are staged to every node and the master process is polled until the job finishes.unsloth.GRPOTrainer with a default rule-based reward instead of a TRL fallback.axolotl, llama-factory, ms-swift, trl, openrlhf) are wrapped in self-contained Python scripts that write their embedded config files at runtime, so they are safe to copy to remote nodes.examples/training_pipeline.yaml for a SFT → DPO → GRPO pipeline sample.NOTES ON 6.0.8
terradev agent sandbox, terradev agent mesh, and terradev agent mcp are now real, dependency-resolving commands instead of placeholders:
terradev agent sandbox runs untrusted payloads with hardware-isolated runtimes (bwrap, runsc, firecracker, and Linux Landlock LSM), all discoverable/downloadable via DependencyManager.terradev agent mesh creates a decentralized peer-to-peer agent mesh using real libp2p (go-libp2p-daemon + p2pclient), A2A HTTP, and WireGuard encrypted transports.terradev agent mcp is a dynamic Model Context Protocol bridge with stdio and HTTP transports and a multi-server bridge.NOTES ON 6.0.0
Unsloth (terradev train unsloth): optimized local LLM training, serving, and coding agents with 70% lower VRAM usage and faster training via Triton kernels. Subcommands: run, start, stop.
terradev train unsloth run --model unsloth/Llama-3.1-8Bterradev train unsloth run --model unsloth/Qwen3.6-7B-GGUF:Q4_K_M --port 8080terradev train unsloth start claude --model unsloth/Llama-3.1-8Bterradev train unsloth stopWeaviate (terradev database weaviate): vector database operations with local, embedded, cloud, and custom environments. Subcommands: up, list-collections, create-collection, delete-collection, insert, query, hybrid-search.
terradev database weaviate up --environment localterradev database weaviate create-collection --name Article --vector-size 384terradev database weaviate insert --collection Article --objects '[{"properties": {"title": "Hello"}, "vector": [0.1, ...]}]'terradev database weaviate query --collection Article --vector '[0.1, ...]' --top-k 5terradev database weaviate hybrid-search --collection Article --query "generative AI" --top-k 5Letta (terradev agent letta): stateful agents with long-horizon memory across sessions. Subcommands: create, list, chat, status, delete, remember.
terradev agent letta create --name my-agent --model openai/gpt-4.1terradev agent letta listterradev agent letta chat --agent-id <id> --message "hello"terradev agent letta remember --agent-id <id> --text "Our staging cluster is on us-east-1" --label factterradev agent letta status --agent-id <id>terradev agent letta delete --agent-id <id>Removed integrations: terradev ml databricks and terradev ml langsmith command groups, all related MCP tools, and Jaeger tracing endpoints in the Helm values have been removed.
Version bumped to 6.0.0 to reflect these breaking changes.
NOTES ON 5.7.10
terradev ml ollama): list, pull, generate, chat, inspect, and check running models on a local Ollama server (list, pull, generate, chat, info, ps).terradev ml deepeval): install, run test suites, list metrics, and evaluate single LLM outputs with metrics like AnswerRelevancyMetric, FaithfulnessMetric, and HallucinationMetric (install, init, run, metrics, evaluate).ollama_* and deepeval_* tool definitions and handlers.NOTES ON 5.7.7
Vault command (terradev vault): store, sync, and use cloud API secrets from environment variables or the encrypted local vault. Designed for GitHub Actions / CI/CD pipelines where secrets are provided as TERRADEV_<PROVIDER>_<KEY> env vars.
terradev vault sync imports supported TERRADEV_<PROVIDER>_<KEY> secrets into the encrypted ~/.terradev/credentials.json (use --all to also import custom keys).terradev vault run -- <command> injects vault secrets into a sub-process and zeroizes them afterwards.terradev now automatically falls back to TERRADEV_* environment variables when the local vault file is missing, so terradev up works directly from GitHub Secrets without a separate configure step.Database command (terradev database): universal database and vector store operations with SQLite, PostgreSQL, Qdrant, and Redis adapters. Subcommands: terradev database up, database down, database crud, database search, database sql, and database qdrant with its own search, scroll, upsert, create-collection, and delete-collection operations.
NOTES ON 5.6.0
Added API Gateway for inference serving with OpenAI/Anthropic/custom API entry and exit points:
Gateway Service (core/gateway_service.py): FastAPI-based gateway that provides OpenAI-compatible, Anthropic-compatible, and custom workflow API endpoints for inference serving. Integrates with Terradev's inference router and KV cache management for intelligent routing.
Gateway CLI command (terradev gateway):
OpenAI-compatible endpoints:
Anthropic-compatible endpoints:
Custom workflow endpoints:
Management endpoints:
Features:
NOTES ON 5.3.9
Added LoRAX (LoRA eXchange) integration and HuggingFace PEFT import for production-grade multi-LoRA inference serving:
LoRAX Service (ml_services/lorax_service.py): Async HTTP client for Predibase LoRAX multi-LoRA inference server that serves thousands of fine-tuned models on a single GPU with dynamic adapter loading, heterogeneous continuous batching, and adapter exchange scheduling.
LoRAX CLI commands (terradev lora lorax):
PEFT Import Service (ml_services/peft_import_service.py): Download, validate, and prepare LoRA adapters from HuggingFace using the PEFT library with auto-detection of rank, alpha, and target modules.
PEFT CLI commands (terradev lora peft):
LoRAX Helm Template (clusters/lorax-template/helm/): Production-ready Kubernetes manifests with GPU resource limits, storage configuration.
Registry Integration: One-step import from HuggingFace and automatic registration in Terradev LoRA registry with version tracking, cross-replica sync, and cost attribution.
NOTES ON 5.3.3
Added provider registration and profiling system for intelligent quirk-aware routing across 17 cloud providers, and registration for custom providers from .yaml import:
ProviderProfile schema (providers/types.py): Encodes provider-specific behaviors including API style (REST/GraphQL/JSON:API), authentication type (Bearer/Basic/HMAC/X-Api-Key), rate limits, spot instance support, egress costs, fallback routing, capacity checks, container image pinning, and spot interruption handling.
Built-in profiles (providers/provider_profiles.py): Pre-configured profiles for all 23 providers (RunPod, Vast.ai, Lambda Labs, AWS, GCP, Azure, Oracle, Crusoe, CoreWeave, DigitalOcean, Yotta Labs, E2E Networks, FluidStack, Alibaba, Hetzner, SiliconFlow, TensorDock, Baseten, HuggingFace, Hyperstack, InferX, Latitude).
Dynamic registration: Users can register custom provider profiles programmatically or load from YAML/JSON files for internal clusters or proprietary cloud providers.
Profile-aware routing (providers/registry.py): ProviderRegistry.ranked_providers() now incorporates provider profiles into scoring, using egress costs, fallback routing preferences, and spot preemption rates for intelligent provider selection.
CLI commands (terradev providers): New command group for managing custom provider profiles:
NOTES ON 5.2.1
Added two new BYOAPI providers: Yotta Labs (Shakti Cloud) and E2E Networks — India's leading GPU clouds. Yotta Labs uses a pod-based compute model (similar to RunPod), and E2E Networks is a traditional VM-style hyperscaler that is NSE-listed and MeitY empanelled. Both are BYOAPI: your key, stored locally, never touches a Terradev server.
NOTES ON 5.0.0
We removed the paywall, open-sourced Terradev, and added accelerators for safe and snappy delivery...
With the DAG orchestrator, the execution graph enforces correct sequencing and idempotency at the runtime level. You or the agent can issue commands freely... the orchestrator ensures they're safe to execute.
217 tools not including subcommand/flags require heavy context. The MCP orchestrator processes tool calls with minimal overhead: deserializing, routing, executing, and responding faster than pure-Python-based MCP servers by an order of magnitude. For an agent running a complex provisioning workflow across 17 cloud providers, that compounds across every tool call in the chain.
Your API keys are stored locally at ~/.terradev/credentials.json and never sent to Terradev servers.
For all cloud provider SDKs and ML integrations:
Verify and list commands:
Terradev supports 17 GPU cloud providers. Start with one, RunPod is the fastest to set up:
This shows you where to get your API key. Then configure it:
Paste your API key when prompted. It's stored locally at ~/.terradev/credentials.json, never sent to a Terradev server. Add more providers later:
The more providers you configure, the better your price coverage.
Check pricing across every provider you've configured:
Output is a table sorted cheapest-first: price/hour, provider, region, spot vs. on-demand. Try different GPUs:
Most clouds hand you GPUs with suboptimal topology by default. Your GPU and NIC end up on different NUMA nodes, RDMA is disabled, and the kubelet Topology Manager is set to none. That's a 30-50% bandwidth penalty on every distributed operation and you'll never see it in nvidia-smi.
When you provision through Terradev, topology optimization is automatic:
What happens behind the scenes:
You don't configure any of this. It's applied automatically.
To preview the plan without launching:
To set a price ceiling:
Option A — Run a command on your provisioned instance:
Option B — One command that provisions, deploys a container, and runs:
Option C — Keep an inference server alive:
Now that your nodes have correct topology, distributed training actually runs at full bandwidth:
The --from-provision latest flag auto-resolves IPs from your last provision command. Supports torchrun, DeepSpeed, Accelerate, and Megatron.
If you're serving a model with vLLM, there are 6 settings most teams leave at defaults — each one costs throughput:
| Knob | Default | Optimized | Impact |
|---|---|---|---|
| max-num-batched-tokens | 2048 | 16384 | 8x throughput |
| gpu-memory-utilization | 0.90 | 0.95 | 5% more VRAM |
| max-num-seqs | 256/1024 | 512-2048 | Prevent queuing |
| enable-prefix-caching | OFF | ON | Free throughput win |
| enable-chunked-prefill | OFF | ON | Better prefill |
| CPU Cores | 2 + #GPUs | Optimized | Prevent starvation |
Auto-tune all six from your workload profile:
Or analyze a running server:
Benchmark:
For large Mixture-of-Experts models (GLM-5, Qwen 3.5, DeepSeek V4), Terradev's MoE templates include every optimization auto-applied — KV cache offloading, speculative decoding, sleep mode, expert load balancing:
Or a smaller model:
What's auto-applied (no flags needed):
This separates inference into two GPU pools optimized for each phase:
The KV cache transfers between them via NIXL — zero-copy GPU-to-GPU over RDMA. This is why getting the NUMA topology right in Step 4 matters: NIXL only runs at full speed when the GPU and NIC share a PCIe switch.
Terradev's inference router automatically uses sticky routing. Once a prefill GPU hands off a KV cache to a decode GPU, future requests with the same prefix go to that same decode GPU, avoiding redundant transfers.
For production, create a topology-optimized K8s cluster:
This auto-configures Karpenter NodePools with NUMA-aligned kubelet Topology Manager, GPUDirect RDMA, and PCIe locality enforcement.
Each step builds on the one before it:
If the provisioning layer is wrong, every optimization above it underperforms. A disaggregated P/D setup with a cross-NUMA KV transfer is slower than a monolithic setup with correct topology.
Terradev handles the foundation automatically so the rest of the stack works the way it's supposed to.
NCCL Connectivity Problems
GPU Memory Issues
Dataset Staging Failures
FlashOptim Compatibility Issues
Checkpoint Recovery Issues
Performance Optimization
Slow Training Speed
Network Bottlenecks
We welcome contributions! Please see our Contributing Guide for details.
Apache 2.0.