How to Implement an On-premises Coding Assistant

This article looks at how to implement an on-premises AI coding assistant using tools like Ollama, Claude Code, VLLM and Opencode.

Implement an On-premises Coding Assistant

Summary

Using open source tools like Ollama and Claude Code to build an on-premises AI coding assistant can help you keep code private, control costs, and improve uptime.

image_pdfimage_print

In this installment of our how-to series on AI, we’ll go over the steps to implement a code assistant. The benefits of running a locally maintained environment include:

  • Data privacy: Code and sensitive data remain within your network
  • Cost control: No per-token pricing or API limits
  • Uptime: No impact due to internet or service interruptions

To showcase this AI use case we will create two configurations, the first being a “laptop friendly” approach, the second providing the first steps towards an enterprise style implementation, “basic client server”. 

Configuration 1 – “laptop friendly”

For our first configuration, we will use an Ubuntu machine with an NVIDIA GPU to serve the model and run the code assistants. The GPU driver versions installed are: 

  • NVIDIA-SMI 570.195.03             
  • Driver version: 570.195.03     
  • CUDA version: 12.8 

To serve our model(s), we’ll use Ollama. This is a well-maintained and stable choice for our setup. We run the installation command: 

See Ollama’s documentation for the complete Linux installation steps

With Ollama installed, we can now download the required model(s) to serve. The available models are listed on the Ollama website.

Considering our coding assistant use case, here are some possible choices. This is not an exhaustive list; the selected model depends on use case and available hardware. Before selecting a model, be sure to review its open source license to determine whether your planned usage is in compliance.  

  • CodeLlama 34B, size 19GB: Good for advanced code completion, debugging, and refactoring
  • Deepseek-Coder 33B,  size 18GB: Good for multi-language support, algorithm implementation, code optimization
  • Mistral 7B Instruct, size 4.1GB: Good for low memory usage, fast inference, excellent instruction following
  • Llama 3.1 70B, size 40GB: Good for advanced reasoning, system design, complex problem-solving
  • Qwen3-coder:30b,  size 19GB: Good for multi-language support, code translation, debugging

As an example, we’ll download qwen3-coder:30b and test a simple query. To download it, run the following:

Coding Assistant – Claude Code

Several coding assistants exist, for our “desktop friendly” configuration we provide the steps for Claude code from Anthropic. Claude code has local Ollama model support since v0.14.0.

As per the installation instructions, run: 

To connect Ollama, add the relevant environment variables to use the Ollama service:

Then, we can start Claude Code by specifying the model to use. 

For Claude code to work correctly the selected model must have the “tools” capability. If not, the following error will occur: 

You can check the tools capability of a model using the following curl command. Here are the outputs against three models:

Note: If the model does not have the thinking capability, it will fail to read local files. If working with Claude Code on a code repository, this is a “nice-to-have” feature. 

ModelThinkingToolsCompletion
qwen3-coder:30bXX
qwen3:32bXXX
gpt-oss:20bXXX
codellama:34bX
deepseek-r1:32bXX
deepseek-coder-v2:16bX
deepseek-coder:33bX

Configuration 2 – “basic client server”

For our second configuration, we will use an NVIDIA DGX Spark to serve the model. The DGX Spark is running as a server (not desktop mode). The GPU driver versions installed are: 

  • NVIDIA-SMI 580.126.09             
  • Driver version: 580.126.09     
  • CUDA version: 13.0

Our model serving endpoint will be accessible remotely allowing us to run the coding assistant from any system on the network.

To serve our model(s), with a production orientated implementation we will use VLLM running within a docker container. NVIDIA provides maintained containers for the VLLM image, refer to the latest versions documentation for more information.

Models for VLLM are pulled from Hugging face, we will be serving Qwen3-Coder-Next-FP8 

From our DGX Spark terminal we start the VLLM container using the following command. In addition to the model parameter (MODEL_NAME), we also specify the context size here set to 32k (MAX_MODEL_LEN), as well as a local volume (-v /mnt/hfCache…) to cache the model(s) files and avoid downloading on each container restart.

Check that the VLLM server has started up and is ready to receive queries:

Run a test query against the endpoint to validate the service, change the IP address and port to those of your running VLLM server:

Within the DGX Spark dashboard we can observe the GPU utilization from the memory allocated to the loaded model to the compute cycles during the above query:

Coding Assistant – Opencode

For our “basic client server” configuration we will use the opensource opencode assistant.

As per the instructions, on our development system we install the opencode utility (there is also a beta desktop application):

Then add the VLLM server to the opencode config file, make sure to change IP address and port: to those of your VLLM endpoints:

We can now run the code assistant:

Our queries will be processed by the model running on the remote DGX Spark.

This “basic client server” configuration allows multiple users to leverage a shared serving endpoint to perform AI assisted code generation.

Conclusion

There can be many reasons to look for alternatives to cloud-based AI solutions, such as costs, data sovereignty, uptime, model capabilities, and output control, to name a few. You may think that implementing such a solution is time-consuming, complex, and not worth the hassle, but as shown in this article, it’s far easier than you might expect.