Skip to main content

Model

Code Llama 13B Instruct

Start with a supported compressed build and short context. 16GB RAM estimate. Best use: Local code explanation and code generation with an instruction/chat prompt format

13BCode

Best use

Local code explanation and code generation with an instruction/chat prompt format

Memory planning

16GB RAM estimate

Expected pace

Depends on your hardware, app, and conversation length

License

Code Llama community license; read the model’s terms before use

Who should use this model?

  • Local code explanation and code generation with an instruction/chat prompt format

Choose something else when

  • You need a modern function-calling/tool-calling model with an official tool schema

What hardware makes sense?

The download is only part of the memory needed. Leave room for the app, the input it processes, and other open programs. For chat models, context includes the instructions, conversation, and answer. Longer context needs more memory.

CPU only
Memory or response time may limit use. Try a smaller model first.
8GB system memory
Use a smaller model for this memory limit.
16GB system memory
A possible starting point with a compressed model and short conversation; check the exact file size.
32GB system memory
A possible starting point with a compressed model and short conversation; check the exact file size.
8GB GPU memory
Memory or response time may limit use. Try a smaller model first.
12GB GPU memory
A possible starting point with a compressed model and short conversation; check the exact file size.
24GB GPU memory
A possible starting point with a compressed model and short conversation; check the exact file size.
Apple unified memory
A possible starting point with a compressed model and short conversation; check the exact file size.

Model facts that change the decision

Parameters
13B
Input
Text
Published context limit
100,000 tokens
Model format
safetensors · transformers · GGUF · Ollama
Suggested compression
Q4_K_M
Typical Q4 file
7.87GB before runtime and context overhead
Languages
English · Python · C++ · Java · PHP · TypeScript · JavaScript · C#

First setup

Ollama

ollama run codellama:13b-instruct

LM Studio: Search for `TheBloke/CodeLlama-13B-Instruct-GGUF` and start with the Q4_K_M file for balanced quality and size.

llama.cpp

Use llama-cli -hf TheBloke/CodeLlama-13B-Instruct-GGUF:Q4_K_M with the Code Llama instruct prompt template

Conditions that change the answer

  • Memory needs include the model file, the app, and conversation memory. Longer conversations and other open apps need more space.
  • Meta describes stable generations up to 100,000 tokens, while common local runtimes and the Ollama catalog may default to smaller contexts such as 16K.

Read the controlling license text →