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.

Sources

Related

  • Project
  • Dispatch
  • Dispatch
  • Dispatch
  • Dispatch