Run Code Llama locally with Ollama
TL;DR
Meta released Code Llama, an open model based on Llama 2 for programming tasks, and Ollama made it available to run locally with simple commands.
## Overview
Code Llama provides state-of-the-art performance among open models, includes infilling capabilities, supports large input contexts, and follows zero-shot instructions for programming tasks.
## Model Variants
Three base sizes are available: 7 billion, 13 billion, and 34 billion parameters. Each size also has a foundation‑model variant and a Python‑specialized variant.
## How to Run with Ollama
To run the base models locally, use the ollama run command with the appropriate tag:
- ollama run codellama:7b
- ollama run codellama:13b
- ollama run codellama:34b
To pull the foundation‑model or Python‑specialized versions, use ollama pull with the corresponding tags:
- Foundation models: ollama pull codellama:7b-code, ollama pull codellama:13b-code, ollama pull codellama:34b-code
- Python specializations: ollama pull codellama:7b-python, ollama pull codellama:13b-python, ollama pull codellama:34b-python
## Example Usage
A sample prompt demonstrates the model’s ability to answer a Bash question:
<br>In Bash, how do I list all text files in the current directory (excluding subdirectories) that have been modified in the last month?<br>
## Implications
By making Code Llama runnable on local hardware through Ollama, developers can experiment with state‑of‑the‑art open code models without relying on remote APIs, enabling offline experimentation and integration into local development workflows.
Related
- Project
ollama/ollamaOllama is a cross‑platform runtime that lets you download and run open‑source large language models locally. It offers a CLI, a REST API (localhost:11434), and official Python/JS SDKs, plus many community integrations (web UIs, LangChain, AutoGPT, etc.). Install with a one‑line script or Docker, then launch models like `ollama run gemma4` or use `ollama launch` to connect to coding assistants or personal bots.
- Dispatch
Ollama launch command releaseOllama has introduced the 'ollama launch' command in version 0.15+, allowing users to set up and run coding tools like Claude Code and OpenCode without manual environment variables or configuration files.
- Dispatch
Code Llama Release NotesCode Llama is a family of open-access models based on Llama 2, specialized for code tasks with support for infilling and long-context windows up to 100,000 tokens.
- Dispatch
OpenAI Codex with Ollama IntegrationOllama now enables the OpenAI Codex CLI to use open-weight models, allowing for local code execution and modification using models like gpt-oss:20b and gpt-oss:120b.
- Dispatch
Llama 3 Availability on OllamaOllama has released support for Llama 3, providing access to the 8B and 70B parameter models with significant improvements in training data, context length, and token efficiency over Llama 2.