AI models & sizing10 min read
Self-hosted AI coding assistant: a private Copilot on your GPU server
A self-hosted AI coding assistant keeps your source code on a GPU server you control, at a fixed monthly price however many developers use it. Here is how to pick a coding model, size the server for a team, serve the model with tool calling, connect VS Code, JetBrains and terminal agents to it, and keep access locked down.
CryptGPU teamPublished

Key takeaways
- A self-hosted AI coding assistant runs an open-weight coding model, such as Qwen3-Coder-Next or Devstral Small 2, on a GPU server you control, behind an OpenAI-compatible API that VS Code, Cline, Continue or Aider can call, so your code is not sent to an outside AI service.
- Autocomplete and agents need different models: Continue’s documentation notes that most state-of-the-art autocomplete models have no more than 10 billion parameters, while coding agents need reliable tool calling and a long context.
- Every request in flight needs its own KV cache: a 64K-token request takes about 10.7 GB on Devstral Small 2 in BF16, but about 1.6 GB on Qwen3-Coder-Next, which keeps a KV cache in only 12 of its 48 layers.
- By CryptGPU’s sizing rule, Qwen3-Coder-Next in FP8 with 16 agent requests of 64K tokens in flight needs about 105 GB: the cheapest server that holds it is 4× RTX 5090 at $1,316 a month.
- VS Code’s built-in chat can use a self-hosted model through a Custom Endpoint without a GitHub account or a Copilot plan, but its inline suggestions cannot use a local model.
What is a self-hosted AI coding assistant?
A self-hosted AI coding assistant is an open-weight coding model running on a GPU server you control, behind an OpenAI-compatible API that your editor or terminal agent calls instead of a cloud service. Your source code, prompts and completions stay on that server, you pay for the server rather than per seat, and you choose the model.
- Private repositories stay private. Code sent as context reaches your server only, and you decide what is logged.
- No per-seat fee, no rate limit. The monthly price is the same for 2 or 20 developers, as long as the server keeps up; the limits are the GPU’s memory and speed.
- Your choice of model. Keep a version that works on your codebase, switch when a better open model appears, or fine-tune one on your own code.
The trade-offs are real. GitHub Copilot’s plans list closed models from Anthropic, OpenAI and Google (GitHub, checked on 19 October 2026), whose weights are not published, so a self-hosted assistant runs an open model whose quality you have to test on your own code. And you run the server yourself. For a private chat on the same kind of server, see how to self-host an LLM.
Autocomplete, chat and agents need different models
| Job | What it needs | Models that fit |
|---|---|---|
| Autocomplete (tab completion) | A small, fast model trained on fill-in-the-middle: it receives the code before and after the cursor and writes what goes between | Qwen2.5-Coder 1.5B or 7B, recommended by Continue; any Qwen3-Coder model |
| Chat and edits | A good instruction model with a context long enough for the files you include | Any model in the next table |
| Agents that read, edit and run code | Reliable tool calling and a long context: an agent sends its instructions, tool definitions and the files it reads with every request | Qwen3-Coder-Next, Devstral Small 2 |
Continue’s documentation notes that “most of the state-of-the-art autocomplete models are no more than 10b parameters, and increasing beyond this does not significantly improve performance”, and that commercial models such as GPT-5 or Claude are not trained with the prompt format autocomplete uses (Continue). Qwen states that fill-in-the-middle “is supported in every version of Qwen3-Coder”, Qwen3-Coder-Next included (Qwen3-Coder), so the agent model can also serve completions if you prefer one model to two. For agents, Ollama advises a context of at least 64,000 tokens for coding tools (Ollama).
Which coding model to self-host
Our catalog has two models built for coding agents, and three general models that can also serve a coding assistant. Memory needed follows our sizing rule, the size of the weights × 1.2 with 92% of GPU memory usable, as on each model page:
| Model | Parameters | Made for | vLLM or SGLang (FP8 or native) | Ollama (default build) |
|---|---|---|---|---|
| Qwen3-Coder-Next | 80B MoE · 3B active | Coding agents and local development, 256K context | 95 GB: 4× RTX 5090, $1,316 | 62 GB: 1× RTX PRO 6000, $959 |
| Devstral Small 2 | 24B | Agentic software engineering, 256K context | 31 GB: 2× RTX 4090, $538 | 18 GB: 1× RTX 4090, $269 |
| Qwen3.8 27B | 27B | Coding and long-horizon agentic tasks, 262K context | 34 GB: 2× RTX 4090, $538 | 22 GB: 1× RTX 4090, $269 |
| gpt-oss-120b | 117B MoE · 5.1B active | Reasoning, native function calling | 78 GB: 1× RTX PRO 6000, $959 | 78 GB: 1× RTX PRO 6000, $959 |
| gpt-oss-20b | 21B MoE · 3.6B active | Lower latency, local use | 17 GB: 1× RTX 4090, $269 | 17 GB: 1× RTX 4090, $269 |
- Qwen3-Coder-Next is a mixture-of-experts model with 80 billion parameters, 3 billion active per token, 262,144 tokens of native context and no thinking mode. Qwen cites integration with CLI and IDE platforms such as Claude Code, Qwen Code, Kilo and Cline, and publishes an official FP8 checkpoint,
Qwen/Qwen3-Coder-Next-FP8. - Devstral Small 2 is a dense 24-billion-parameter model published in FP8, with a 256K window. Mistral calls it “light enough to run on a single RTX 4090”: by our rule, Ollama’s 15 GB build fits one, the full FP8 weights need two.
- Qwen3.8 27B thinks by default, which you can turn off per request; gpt-oss lets you set its reasoning effort to low, medium or high. Both also answer non-coding questions.
Larger models in our open models catalog, such as GLM-5.3-Flash and Kimi K2.6, need multi-GPU servers. Test two candidates on your own repositories before you settle. Model facts from the cards on Hugging Face: Qwen3-Coder-Next, Qwen3-Coder-Next-FP8, Devstral Small 2, Qwen3.8 27B, gpt-oss-120b, gpt-oss-20b; Ollama build sizes from its library.
How much GPU memory a team of developers needs
Our rule covers a few requests at moderate context. A team needs more, because every request in flight carries its own KV cache, the keys and values of every token of its context, and agent requests are long. Size for the requests running at the same moment, not for the number of seats:
memory needed = weights + KV cache per request × requests in flight
KV per token = 2 × attention layers × KV heads × head dimension × 2 bytes (BF16)
Devstral Small 2 has 40 layers with 8 KV heads of dimension 128: about 0.16 MB per token, 10.7 GB for a request of 64K tokens (65,536). Qwen3-Coder-Next keeps a KV cache in only 12 of its 48 layers, with 2 KV heads of dimension 256; the other 36 use Gated DeltaNet, a linear attention whose state this formula does not count. That is about 0.025 MB per token, 1.6 GB per 64K request (Devstral config, Qwen config). With FP8 weights:
| 64K-token requests in flight | 8 | 16 | 32 |
|---|---|---|---|
| Devstral Small 2, BF16 KV cache | 112 GB: 4× RTX 5090, $1,316 | 198 GB: 4× RTX PRO 6000, $3,836 | 370 GB: 8× RTX PRO 6000, $7,672 |
| Devstral Small 2, FP8 KV cache | 69 GB: 1× RTX PRO 6000, $959 | 112 GB: 4× RTX 5090, $1,316 | 198 GB: 4× RTX PRO 6000, $3,836 |
| Qwen3-Coder-Next, BF16 KV cache | 92 GB: 4× RTX 5090, $1,316 | 105 GB: 4× RTX 5090, $1,316 | 131 GB: 2× RTX PRO 6000, $1,918 |
- Hybrid attention pays off for teams. Qwen3-Coder-Next has three times the weights of Devstral Small 2, yet needs less memory from 6 requests in flight with a BF16 cache.
- An FP8 KV cache takes half the bytes (
--kv-cache-dtype fp8in vLLM, which recommends calibrated scales for the best quality: vLLM). One RTX PRO 6000 then holds Devstral Small 2 with 11 requests. - The cheapest fit is not always the simplest. Four RTX 5090 split the model over PCIe; one H200 ($2,279) holds Qwen3-Coder-Next with room for about 31 requests of 64K tokens on a single GPU.
Treat these as estimates: engines need memory of their own, and real requests vary in length. The same sum applies to one developer: with a 64K context, Devstral Small 2 from Ollama takes about 26 GB with Ollama’s default f16 cache (cheapest fit: 1× RTX 5090 at $329 a month), or 20 GB with OLLAMA_KV_CACHE_TYPE=q8_0 (1× RTX 4090 at $269). Once the team is on it, watch the waiting requests and KV cache usage (vLLM metrics). The sizing helper covers any other model, and the best GPU for LLM inference compares bandwidth and price per GB.
Serve the model with tool calling
Agents work through tools, so the engine must parse the model’s tool calls: in vLLM, --enable-auto-tool-choice plus the parser for the model (vLLM). For Qwen3-Coder-Next, with the parser from its model card (vLLM 0.15.0 or later):
# on the server: one H200; on two GPUs, add --tensor-parallel-size 2
KEY=$(openssl rand -hex 32); echo "$KEY"
vllm serve Qwen/Qwen3-Coder-Next-FP8 --served-model-name qwen3-coder-next \
--host 127.0.0.1 --port 8000 --api-key "$KEY" \
--enable-auto-tool-choice --tool-call-parser qwen3_coder \
--max-model-len 131072
--served-model-namegives your tools a short model name, and--max-model-lencaps each request at 131,072 tokens (the model accepts 262,144), which bounds the cache per request.- Devstral Small 2 takes
--tool-call-parser mistral --enable-auto-tool-choice, gpt-oss theopenaiparser. - SGLang 0.5.8 or later takes the same parser in the model card’s command, plus
--api-key, and listens on 127.0.0.1:30000 by default (SGLang). - With Ollama,
ollama pull devstral-small-2is enough to start, but its API checks no key, it handles one request per model at a time unless you raiseOLLAMA_NUM_PARALLEL, and its default context is 4K tokens below 24 GiB of GPU memory. SetOLLAMA_CONTEXT_LENGTHto at least 64000 in the service settings of our Ollama guide.
Installation, Docker and multi-GPU options are in serving LLMs with vLLM.
Connect VS Code, JetBrains or a terminal agent
Every tool below calls the same endpoint, http://localhost:8000/v1 through the SSH tunnel of the next section, with the key and the served model name. VS Code’s built-in chat can use it directly: open Chat: Manage Language Models, choose Add Models, then Custom Endpoint with the Chat Completions API type, and complete the chatLanguageModels.json file VS Code opens:
[
{
"name": "GPU server",
"vendor": "customendpoint",
"apiKey": "${input:gpuServerKey}",
"apiType": "chat-completions",
"models": [
{
"id": "qwen3-coder-next",
"name": "Qwen3-Coder-Next (self-hosted)",
"url": "http://localhost:8000/v1/chat/completions",
"toolCalling": true,
"vision": false,
"maxInputTokens": 114688,
"maxOutputTokens": 16384
}
]
}
]
The two token limits add up to the server’s --max-model-len, and toolCalling makes the model available to agents in chat. VS Code documents that such models work without a GitHub account or a Copilot plan, but not for completions: “Currently, you cannot connect to a local model for inline suggestions” (VS Code docs). On a company Copilot plan, the administrator’s policy must allow your own models.
| Tool | Runs in | How to point it at your server |
|---|---|---|
| Cline | VS Code, JetBrains, terminal | API Provider “OpenAI Compatible”, Base URL http://localhost:8000/v1, your key, Model ID qwen3-coder-next (docs). Every file edit and terminal command needs your approval unless you turn on auto-approve (GitHub). |
| Kilo Code | VS Code, JetBrains, terminal | Settings, Providers, Custom provider: Provider API “OpenAI Compatible”, same Base URL and key (docs) |
| Aider | Terminal | OPENAI_API_BASE and OPENAI_API_KEY in the environment, then aider --model openai/qwen3-coder-next (docs) |
| Continue | VS Code, JetBrains | config.yaml: provider: openai with apiBase and apiKey, capabilities: [tool_use] for Agent mode, and a second model with the autocomplete role (docs, reference). Since its final 2.0.0 release, the repository is read-only and no longer maintained (GitHub). |
| Tabby | Its own server, with IDE plugins | config.toml: a vllm/completion model with a fill-in-the-middle prompt template, for code completion (docs) |
| Roo Code | — | Shut down on 15 May 2026; its repository is archived (GitHub) |
For tab completions, use Continue’s autocomplete role or Tabby, with a small fill-in-the-middle model next to the agent model. Continue’s example is qwen2.5-coder:1.5b from Ollama, a 986 MB build; it is not in our catalog, but as root you can install any model.
Give the team secure access
Keep the engine on 127.0.0.1 and never publish port 8000 (vLLM), 30000 (SGLang) or 11434 (Ollama). vLLM’s key protects only some routes, and its security guide warns against relying on it alone. Two safe ways in:
An SSH tunnel per developer. Put each developer’s public key on its own line in a tunnel-only account: the key can forward to the API port and nothing else, and deleting the line revokes that person (sshd manual):
# on the server, once
sudo useradd -m -s /usr/sbin/nologin tunnel
sudo install -d -m 700 -o tunnel -g tunnel /home/tunnel/.ssh
# one line per developer, with their public key
echo 'restrict,port-forwarding,permitopen="127.0.0.1:8000" ssh-ed25519 AAAA... alice@laptop' \
| sudo tee -a /home/tunnel/.ssh/authorized_keys
# on each developer’s computer; the API is then at http://localhost:8000/v1
ssh -N -L 8000:127.0.0.1:8000 tunnel@203.0.113.10
restrict disables forwarding and terminals, port-forwarding turns forwarding back on, permitopen limits it to the API, and the nologin shell gives no command line. Keys and ~/.ssh/config are covered in SSH access.
A TLS reverse proxy for people without SSH: Caddy forwarding only /v1/ (our example), limited to your team’s IP addresses. Everyone then shares the API key, so replace it when someone leaves.
Where CryptGPU fits
CryptGPU rents dedicated GPU servers by the month, from one GeForce card to eight data-center GPUs, with root SSH access and no other tenant on your cards. Qwen3-Coder-Next and Devstral Small 2 are in our catalog: when you order, the Software step can install vLLM, SGLang or Ollama with Open WebUI and either model at no extra cost, and the server is online in under 10 minutes once the payment is confirmed on-chain. The tunnel accounts, editor settings and any autocomplete model are yours to add. The price is per server, not per developer: $269 a month for an RTX 4090, $959 for an RTX PRO 6000, $2,279 for an H200. You pay in Bitcoin, Ethereum, USDT, Monero or Litecoin, with no KYC.
It is not the right choice if you need a closed model, a managed service with single sign-on, or a GPU for a few hours a week. You administer the server, updates and security included, and we publish no SLA. A server that is not renewed stops at the end of the paid month and its disks are wiped, so keep your configuration and any fine-tuned adapters elsewhere.
Common questions
Can a self-hosted model replace GitHub Copilot?
For chat and agents, the tools above give you the same workflow with your own model. Two things differ: Copilot’s closed models cannot be self-hosted, so results depend on the open model you pick, and tab completions need an extension such as Continue or Tabby, since VS Code’s inline suggestions cannot use a local model.
Which coding model runs on a single GPU?
By our rule, gpt-oss-20b from Ollama fits one RTX 4090 ($269 a month), and Devstral Small 2 with a 64K context one RTX 5090 ($329); Qwen3-Coder-Next from Ollama (52 GB, 4-bit) and gpt-oss-120b fit one RTX PRO 6000 ($959). For full FP8 weights and a team, see the table above.
How many developers can share one server?
It depends on how many requests run at the same moment and how long they are, not on the number of seats. Size for your peak with the formula above, then watch vLLM’s waiting requests: requests that queue while the KV cache is full mean you need more memory or shorter contexts.
Does my code leave the server?
The model runs on your server, so prompts and completions reach no model provider. Editors and extensions can still send usage data to their makers, and an agent reaches the internet if you give it tools that do: check their settings. Continue’s final release removed its anonymous telemetry.




