Back to models
Model Intelligence FileOpen source

codellama

Code Llama is a family of large language models for code, released by Meta AI, based on Llama 2 and fine-tuned on code-specific datasets. It comes in 7B, 13B, 34B, and 70B parameter sizes with base, Python-specialized, and instruction-following variants. The model supports code generation, completion, infilling, explanation, debugging, and documentation across multiple programming languages. It is available under a custom commercial license and can be deployed locally via Ollama, Hugging Face, or other frameworks.

Depth
907

word-level signal

Categories
1

topic cluster links

Index status
Live

Jun 26, 2026

Deep Brief

Overview and use cases

Overview

Code Llama is a family of large language models (LLMs) for code, released by Meta AI. It is built on top of Llama 2 and fine-tuned on code-specific datasets to excel at code generation and understanding. The model family includes four parameter sizes: 7 billion, 13 billion, 34 billion, and 70 billion parameters. Each size comes in three variants: the base model (Code Llama), a Python-specialized version (Code Llama - Python), and an instruction-following version (Code Llama - Instruct). The 7B and 13B models also support fill-in-the-middle (FIM) capability, allowing them to insert code in the middle of a prompt. Code Llama is designed to run locally on consumer hardware; the 7B model can run on a single GPU, while larger models require more powerful hardware. It supports many popular programming languages, including Python, C++, Java, PHP, TypeScript (JavaScript), C#, Bash, and more.

Capabilities

  • Code Generation: Generate code from natural language descriptions.
  • Code Completion: Complete partial code snippets.
  • Code Infilling: Fill in missing code in the middle of a file using FIM mode with special tokens <PRE>, <SUF>, and <MID>.
  • Code Explanation: Explain code in natural language.
  • Debugging: Help identify and fix bugs.
  • Documentation: Generate documentation for code.
  • Multi-language Support: Supports many popular programming languages.
  • Instruction Following: The Instruct variant can follow instructions for code-related tasks.
  • Variants: Base model for code completion, Python-specialized for Python code, and Instruct for helpful and safe natural language responses.

Use cases

  • Assisted Coding: Use as a coding assistant in IDEs or terminals via Ollama or API.
  • Learning: Help beginners understand code and learn programming.
  • Code Review: Analyze code for potential issues.
  • Automation: Generate boilerplate code or scripts.
  • Education: Create coding exercises and explanations.
  • Research: Experiment with code generation and understanding.
  • Fill-in-the-Middle: Complete code between two existing blocks, useful for inline code completion.
  • Unit Test Generation: Write unit tests for existing functions.

License & deployment

Code Llama is released under a custom commercial license that allows use for both research and commercial purposes, with the requirement that any use must comply with acceptable use policies. The model can be deployed locally using Ollama, which simplifies running LLMs on personal machines. To run Code Llama with Ollama, use the command ollama run codellama. The model is also available on Hugging Face and can be used with other frameworks like Transformers. Deployment options include CLI, cURL, Python, and JavaScript APIs. The model sizes and context windows are: 7B (3.8GB, 16K context), 13B (7.4GB, 16K context), 34B (19GB, 16K context), and 70B (39GB, 2K context).

Alternatives

  • StarCoder: A 15B parameter model trained on code, with a permissive license.
  • CodeGen: A family of models by Salesforce for code generation.
  • GPT-4: Proprietary model with strong code capabilities.
  • Claude: Anthropic's model with code understanding.
  • Llama 2: The base model for Code Llama, also capable of code tasks.
  • DeepSeek Coder: Open-source code model with competitive performance.
  • Mistral Code: Mistral AI's code-focused model.

FAQ

Q: What is Code Llama? A: Code Llama is a family of large language models for code, released by Meta AI, based on Llama 2 and fine-tuned on code-specific datasets.

Q: What sizes are available? A: Code Llama comes in 7B, 13B, 34B, and 70B parameter sizes.

Q: What variants exist? A: Each size has three variants: base (Code Llama), Python-specialized (Code Llama - Python), and instruction-following (Code Llama - Instruct).

Q: What is fill-in-the-middle (FIM)? A: FIM allows the model to insert code in the middle of a prompt using special tokens <PRE>, <SUF>, and <MID>. It is supported on 7B and 13B models.

Q: What programming languages are supported? A: Python, C++, Java, PHP, TypeScript (JavaScript), C#, Bash, and more.

Q: How can I run Code Llama locally? A: Use Ollama with ollama run codellama or download from Hugging Face and use with Transformers.

Q: What is the license? A: A custom commercial license allowing research and commercial use, subject to acceptable use policies.

Q: What are the hardware requirements? A: The 7B model can run on a single GPU; larger models require more powerful hardware. Model sizes: 7B (3.8GB), 13B (7.4GB), 34B (19GB), 70B (39GB).

Q: Can I use Code Llama for commercial purposes? A: Yes, under the custom commercial license.

Q: How does Code Llama compare to GPT-4? A: Code Llama is open-source and can run locally, while GPT-4 is proprietary and cloud-based. Performance varies by task.

Q: What is the context window? A: 16K tokens for 7B, 13B, and 34B models; 2K tokens for the 70B model.

Q: How do I use the Instruct variant? A: Use the -instruct tag, e.g., ollama run codellama:7b-instruct.

Q: How do I use the Python variant? A: Use the -python tag, e.g., ollama run codellama:7b-python.

Q: Can I fine-tune Code Llama? A: Yes, it is open-source and can be fine-tuned on custom datasets.

Q: Is Code Llama safe? A: Meta has implemented safety measures, but users should follow acceptable use policies.

Q: Where can I find more information? A: Official documentation at https://ollama.com/library/codellama and Hugging Face model cards.

Keep Exploring

Related AI models

Model library

lpiccinelli

lpiccinelli/unidepth-v2-vitl14 · Hugging Face

UniDepth v2 (ViT-L/14) is a 0.4B-parameter PyTorch model for monocular metric depth estimation, leveraging a Vision Transformer backbone to predict scale-aware depth maps from single RGB images.

Open sourceUniDepth

Qwen

Qwen/Qwen3-8B · Hugging Face

Qwen/Qwen3-8B is an 8-billion parameter large language model developed by Alibaba Cloud's Qwen team, available on Hugging Face under the Apache 2.0 license. It is designed for advanced text generation, conversational AI, and complex reasoning tasks, featuring support for tool use and long-context understanding.

Open sourcetransformers

google-t5

google-t5/t5-small · Hugging Face

T5-small is a compact, multilingual encoder-decoder transformer model developed by Google and hosted on Hugging Face. Licensed under Apache 2.0, it supports text-to-text generation tasks such as translation, summarization, and question answering across multiple languages including English, French, German, and Romanian. It is optimized for low-latency inference and efficient deployment on various hardware backends.

Open sourcetransformers

Qwen

Qwen/Qwen3-0.6B · Hugging Face

Qwen/Qwen3-0.6B is a lightweight, open-source large language model developed by Alibaba Cloud's Qwen team. Released under the permissive Apache 2.0 license, this 0.6-billion-parameter model is designed for high-efficiency deployment on consumer-grade hardware, including CPUs and low-end GPUs. It features a 32,768-token context window, multilingual capabilities, and native support for tool-use and function calling, making it an ideal candidate for edge computing, real-time chatbots, and resource-constrained environments.

Open sourcetransformers

Ollama

llava

LLaVA (Large Language and Vision Assistant) is an open-source, end-to-end trained multimodal model that combines a vision encoder with a large language model (Vicuna) to enable visual understanding and reasoning. Developed by researchers from Microsoft, the University of Wisconsin-Madison, and Columbia University, LLaVA allows users to interact with images through natural language, supporting tasks such as visual question answering, image captioning, and complex visual reasoning. The latest iteration, LLaVA 1.6, introduces significant improvements in input resolution, visual instruction tuning, and logical reasoning capabilities. It is widely accessible for local deployment via Ollama, offering privacy, offline functionality, and flexible hardware requirements across various model sizes.

Open source

BAAI

BAAI/bge-small-en-v1.5 · Hugging Face

BAAI/bge-small-en-v1.5 is a lightweight, high-performance sentence embedding model developed by the Beijing Academy of Artificial Intelligence (BAAI). Based on the BERT architecture with approximately 33 million parameters, it generates 384-dimensional vector representations optimized for English text. It is widely used for semantic search, retrieval-augmented generation (RAG), and clustering tasks, offering a balance between computational efficiency and accuracy under the permissive MIT License.

Open sourcesentence-transformers

Site Discovery

Keep exploring ToolSeekAI

Move from model intelligence into tools, news, and rankings for a stronger AI decision path.