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
- Memory or response time may limit use. Try a smaller model first.
- 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
- A possible starting point with a compressed model and short conversation; check the exact file size.
- 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
- 7B
- Input
- Text
- Published context limit
- 100,000 tokens
- Model format
- safetensors · transformers · GGUF · Ollama
- Suggested compression
- Q4_K_M
- Typical Q4 file
- 4.08GB before runtime and context overhead
- Languages
- English · Python · C++ · Java · PHP · TypeScript · JavaScript · C#
First setup
Ollama
ollama run codellama:7b-instructLM Studio: Search for `TheBloke/CodeLlama-7B-Instruct-GGUF` and start with the Q4_K_M file for balanced quality and size.
llama.cpp
Use llama-cli -hf TheBloke/CodeLlama-7B-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 →