
Want to install Code Llama locally on Windows? The simplest current route is Ollama: it installs as a native Windows app, downloads the model you choose, and gives you a local command-line chat plus an API for your own tools. This guide uses the official Ollama model library and avoids the older multi-step web-UI setup.
2026 reality check: Code Llama still runs, but it is an older model built on Llama 2. Meta archived its Code Llama inference repository in July 2025. Use it for compatibility, offline experiments and learning—not because it is the newest coding model. For a broader comparison, see our coding LLM guide.
What you need before installing Code Llama
- Windows 10 22H2 or newer, according to Ollama’s current Windows documentation.
- At least 4GB of free space for the Ollama installation, plus model storage. Model files range from about 3.8GB for 7B to 39GB for 70B.
- Enough system RAM or GPU memory for the model you select. The 7B model is the sensible starting point for most personal computers.
- An internet connection for the initial installer and model download. After that, prompts can run locally.
An NVIDIA or supported AMD GPU can improve speed, but a dedicated GPU is not required to try the smaller model. Larger models need substantially more memory and disk space, so start small and only scale up if the experience is usable.
Step 1: Install Ollama for Windows
Download the Windows installer from the official Ollama website and run it. Ollama installs for your user account and normally does not require administrator access. It then runs in the background and makes the ollama command available in PowerShell, Command Prompt or Windows Terminal.
Open a new PowerShell window and confirm the command is available:
ollama --versionIf Windows says the command is not recognised, close and reopen the terminal first. If that fails, restart Ollama from the Start menu and check the troubleshooting section below.
Step 2: Download and run Code Llama
For question-and-answer style coding help, use the instruction-tuned 7B model:
ollama run codellama:7b-instructOllama downloads the model the first time, then opens an interactive prompt. Try a small, testable request such as:
Write a Python function that validates an IPv4 address. Include tests and explain the edge cases.Type /bye to leave the session. The model stays stored locally, so the next launch is faster.
Which Code Llama model should you choose?
| Model | Ollama command | Approx. download | Best fit |
|---|---|---|---|
| 7B Instruct | ollama run codellama:7b-instruct | 3.8GB | Best first install; coding questions and explanations |
| 7B Python | ollama run codellama:7b-python | 3.8GB | Python-focused generation |
| 13B Instruct | ollama run codellama:13b-instruct | 7.4GB | More capable, but needs more memory |
| 34B Instruct | ollama run codellama:34b-instruct | 19GB | Higher-end workstation |
| 70B Instruct | ollama run codellama:70b-instruct | 39GB | Powerful local hardware or a server |
The download size is only a rough planning guide; runtime memory use varies with model, quantisation and context length. If a larger model is slow or Windows starts paging heavily, remove it and return to 7B. Read our background guide to Code Llama 70B before committing to the largest download.
Useful Ollama commands
| Task | Command |
|---|---|
| See downloaded models | ollama ls |
| Run the default Code Llama model | ollama run codellama |
| Show local model details | ollama show codellama:7b-instruct |
| Remove a model | ollama rm codellama:7b-instruct |
How to get better coding answers
- State the language and version. Mention Python 3.12, PowerShell 7 or the framework version you actually use.
- Give the constraints. Describe inputs, expected output, performance needs and libraries that are allowed.
- Ask for tests. A runnable test case makes errors easier to spot.
- Work in small pieces. Ask for one function or change at a time rather than an entire application.
- Review every output. Run code in a safe test environment and check security, licences and dependencies before using it.
Do not paste production passwords, API keys, private customer data or proprietary source code into any tool unless your organisation has approved the workflow. “Runs locally” describes where inference happens; your wider setup, plugins and connected applications still determine what data may leave the computer.
Change where Ollama stores models
Models can use tens or hundreds of gigabytes. If your Windows user drive is short on space, create a user environment variable named OLLAMA_MODELS and point it to a folder on another drive. Quit the Ollama tray app and reopen it after changing the variable. Ollama’s Windows documentation has the current steps and storage locations.
Troubleshooting Code Llama on Windows
“ollama” is not recognised
Open a new terminal after installation. Confirm Ollama is running from the Start menu. The standard installer adds the program folder to your user PATH.
The download fails or stops
Check free disk space, temporarily retry without a restrictive VPN or proxy, and run the same command again. Ollama will handle the model download.
Responses are extremely slow
Close memory-heavy applications and try the 7B model. A larger parameter count is not useful if your computer is constantly moving model data between RAM and disk.
Where are the logs?
Ollama’s current Windows documentation lists logs under %LOCALAPPDATA%\Ollama. The file server.log is the useful first place to check.
Frequently asked questions
Can Code Llama run without the internet?
Yes. You need internet access to install Ollama and download the model, but ordinary prompts can then run locally. Integrations that call online services are a separate matter.
Is Code Llama still worth installing in 2026?
It is useful for reproducing older workflows, experimenting with a small local coding model and learning Ollama. For a new daily coding assistant, compare it with current models before deciding. Code Llama remains in Ollama’s library, but Meta’s original inference repository is archived.
Is Ollama the only way to install Code Llama?
No. Other runtimes and interfaces exist, but Ollama provides one of the shortest supported Windows installation paths and a local API at http://localhost:11434.
Bottom line
Install Ollama, start with ollama run codellama:7b-instruct, test it with small coding tasks and only move to a larger model if your hardware handles the 7B version comfortably. Keep human review and testing in the loop: local AI can be convenient, but it can still produce insecure or incorrect code.
Sources checked July 2026: Ollama Windows documentation, Ollama Code Llama library, and Meta’s official Code Llama repository.
What I’d try next in 2026
Code Llama is still useful for learning, but I would not stop here. If you want a more flexible local server, follow the llama.cpp MCP setup guide. For an easier Docker-based local API, try installing LocalAI on Windows. If your goal is coding rather than model hosting, compare DeepSeek V4 Flash with Codex or build a multi-agent workflow with the GitHub Copilot SDK.