CLOUD
AI

A Self-Hosted AI Coding Assistant: Your Code Never Leaves Your Infrastructure

CLOUD|September 29, 2026|7 min read|176 views
A Self-Hosted AI Coding Assistant: Your Code Never Leaves Your Infrastructure

Run an open coding model like Qwen2.5-Coder through Ollama on a Saudi server, wired to your team's editor via the Continue extension, so code and secrets stay inside your infrastructure. We cover the hardware in numbers and the realistic quality limits versus cloud models.

If your company blocks cloud coding assistants over fear of leaking code and secrets, the practical answer is to run an open-source coding model like Qwen2.5-Coder or DeepSeek-Coder through Ollama on a Saudi cloud server, then wire it to your team's editor via the Continue extension in VS Code or JetBrains. The result: every line of code and every API key stays inside your infrastructure in Riyadh, and the assistant runs over the company network with no external connection.

The practical decision in one line: for CPU-only use (no GPU), a 7-billion-parameter model in int4 gives acceptable chat and code review on a Business plan with 8GB RAM, but it is slow for live autocomplete. For higher quality close to cloud models, you need a 32-billion-parameter model with 24GB RAM or a GPU, which goes beyond the standard plans. Be realistic: CPU self-hosting is excellent for chat, explanation, and review, while live autocomplete during typing benefits greatly from a GPU.

This guide explains why companies block cloud assistants, how to run an open model through Ollama, how to connect it to team editors, then sets the required hardware in numbers and the realistic quality limits honestly.

Why companies block cloud assistants

A coding assistant needs to read your code to help you, which means parts of the codebase are sent to the provider's server to generate a suggestion. For many companies this is a red line, and the reasons are real:

  • Secret leakage: config files sometimes hold API keys and database passwords, and if they pass through an external server, a third party now has them.
  • Code intellectual property: the algorithms and business logic a company built over years should not leave its infrastructure for the sake of developer convenience.
  • Regulatory obligation: government and financial entities are required to keep data inside the Kingdom, and any tool that uploads code to an external server breaks that obligation directly.
  • Training on your code: some provider policies allow using your inputs to improve their models unless you pay for a plan that explicitly forbids it.

Self-hosting solves these concerns at the root: the model runs on your server, code never leaves your network, and no third-party policy governs your data. An important extra benefit for government entities is that an open model works even in networks fully isolated from the internet, because once downloaded it needs no external connection, giving you a complete coding assistant inside a closed environment that does not allow reaching cloud services in the first place.

Running the model through Ollama

Ollama reduces running open models to roughly one command: you pick the model, it downloads once, and it runs as a service exposing a local API on port 11434. The models suited to coding today:

ModelSizeApprox. int4 memoryPlan fitBest use
Qwen2.5-Coder 1.5B1.5 billion~1.5GBGrowth 4GBSimple completion, limited machines
Qwen2.5-Coder 7B7 billion~5GBBusiness 8GBChat and code review, most common
DeepSeek-Coder 6.7B6.7 billion~5GBBusiness 8GBFunction generation and explanation
Qwen2.5-Coder 14B14 billion~9GBEnterprise 16GBHigher quality for serious projects
Qwen2.5-Coder 32B32 billion~20GBEnterprise + extra RAMClosest to cloud models

The int4 format (four-bit quantization) shrinks the model in memory to roughly a quarter with a slight quality loss, and it is the practical choice on CPU. The 7B model is the most popular balance point: it fits a Business plan comfortably and leaves room for the rest of the server's services.

Connecting the assistant to team editors

After running Ollama on the server, each developer connects their editor to the model API through the open Continue extension, available for VS Code and the JetBrains family. The setup points the extension to the internal server address, so every assistant feature (side chat, explaining a selected code block, generating a function, suggesting a fix) passes through your server rather than any external service.

Short steps

  • Install Ollama on a Business or Enterprise server, or start with a ready template from AI hosting.
  • Pull the Qwen2.5-Coder 7B model, and make sure the service listens on the team's private network only, not the open internet.
  • Install the Continue extension in each developer's editor, and point it to the server address and the Ollama port.
  • Close outside access with the firewall or a private network, since the assistant must never be exposed to the world.

This design gives an entire team a shared assistant at the fixed annual cost of one server, instead of a monthly subscription per developer that grows with the team.

The required hardware in numbers

Honesty matters here. On CPU alone, generation speed is measured in tokens generated per second:

Model on a modern CPUApprox. speedUsage fit
7B int4~5 to 15 tokens/secComfortable chat and review, relatively slow completion
14B int4~3 to 7 tokens/secHigher quality, more patience
32B int4~1 to 3 tokens/secSlow on CPU, better with a GPU

The practical reading: for chat, code explanation, and generating a function now and then, the 7B model on a Business plan with 8GB RAM is a good experience. For live autocomplete during typing (which needs a sub-second response), CPU alone may not be enough, and here a GPU becomes justified. A RAM upgrade at 600 SAR per 2GB moves you from 7B to 14B, one of the most impactful upgrades. See pricing and plans to balance RAM against your need.

Cost: per-developer subscription versus a fixed server

Cloud assistants price monthly per developer, and the amount piles up quickly as the team grows, while self-hosting has a fixed cost on one server that serves the whole team. The table shows the difference assuming a mid-range cloud subscription near 90 SAR per developer per month:

Team sizeCloud subscription (90 SAR/dev/month)Self-hosted Business server (11,500/year)
3 developers~3,240 SAR/year11,500 SAR fixed
10 developers~10,800 SAR/year11,500 SAR fixed
25 developers~27,000 SAR/year11,500 SAR fixed

The reading: a small team may find the subscription cheaper in money terms, but the break-even sits near ten developers, after which the self-hosted server is clearly cheaper, on top of code never leaving your infrastructure at any size. Remember too that the server serves tasks beyond the assistant, so the cost is shared, not dedicated to this purpose alone.

Keeping the assistant private and secure

The biggest mistake after running the model is exposing the Ollama API on the open internet, because any unauthenticated API on a public port becomes a target within minutes. The rule is that Ollama should listen on the private network only, with the team reaching it through a private VPN such as WireGuard or an unexposed internal address. Set the firewall to block any external connection to the model port, since the assistant is a purely internal tool that no one outside the team should see. This takes minutes and protects the most valuable thing you own: your code and your infrastructure.

Realistic quality limits

We will not sell you an illusion: an open 32B model approaches the quality of large cloud models on many daily tasks (generating functions, explaining code, writing tests, suggesting fixes), yet it stays weaker on very complex tasks that need long reasoning across many files. The practical rule: the open model covers 80% of a developer's daily tasks at excellent quality, and the complex 20% may need more human review. The decisive advantage is that this 80% happens without code leaving your infrastructure, and that alone justifies the choice for any sensitive entity.

Conclusion: a starting plan

Start with a Business plan, install Ollama with Qwen2.5-Coder 7B, connect two developers with the Continue extension, and trial a full week on real tasks. Measure your satisfaction in practice, not in theory. If you need higher quality, move to 14B with a RAM upgrade, and if you need fast live completion, plan for a GPU. Most importantly, from day one you get a full coding assistant for your team at a fixed cost, and your code never leaves your Saudi server. Try the AI hosting template to shorten setup and start in minutes.

Share