Description
Code Llama is Meta's family of large language models specialized for code, created by taking Llama 2 and training it further on code-specific datasets. It is designed for general code synthesis and understanding: generating code and natural-language explanations of code from prompts, completing partial code, and infilling code based on surrounding context.
Read More
The family comes in three parameter sizes (7B, 13B and 34B, with a 70B size added later) and three variants at each size: the base Code Llama model for general code synthesis and understanding, Code Llama - Python, tuned specifically for Python, and Code Llama - Instruct, tuned for instruction-following and safer use in code-assistant applications. The models are auto-regressive transformers that take text input and produce text output, trained by Meta between January and July 2023 on a fixed, offline dataset; they are static releases rather than continuously updated ones. Documented model capabilities include code completion, infilling, instruction and chat interaction, and Python specialization, with language coverage including Python, C++, Java, PHP, TypeScript (JavaScript), C# and Bash.
This Hugging Face organization packages the models in the Transformers format for easy loading with the transformers and accelerate libraries; Meta's own official repository is hosted separately under its Meta Llama organization. Before downloading, the models can be tried through hosted demos: the Code Llama Playground for the base 13B model, Code Llama Chat for the 13B instruction-tuned model, and a 34B instruction-tuned version available through Hugging Chat.
Code Llama and its variants are licensed under Meta's custom commercial license and are intended for commercial and research use in English and the supported programming languages; use outside that scope, or in violation of Meta's acceptable use policy, is out of scope for the license.
Code Llama is aimed at developers and researchers building code generation, completion or coding-assistant applications who want an open, self-hostable alternative to a closed code-generation API.
- CategoryAI Models & LLMs
- Pricing ModelOpen source
- DeploymentCloud, Self-hosted
- PlatformsWeb
Code Llama Highlights
Code generation and natural-language explanation of code from prompts
Code completion and infilling based on surrounding context
Instruction-following Instruct variants for chat-style coding assistance
Python-specialized variants tuned specifically for that language
Available in 7B, 13B, 34B and 70B parameter sizes
Covers Python, C++, Java, PHP, TypeScript/JavaScript, C#, Bash and more
Distributed as Hugging Face Transformers-format checkpoints for each size and variant
Hosted demos (Playground, Chat, Hugging Chat) for trying models before downloading
Getting Started with Code Llama
Pick a size and variant: Choose a parameter size (7B, 13B, 34B or 70B) and variant (base, Python or Instruct) for your task.
Install the library: Install the Hugging Face transformers and accelerate packages.
Load the model: Download the chosen codellama/* checkpoint from Hugging Face.
Try a demo first: Test the Code Llama Playground, Code Llama Chat or Hugging Chat demo before deploying your own.
Prompt the model: Ask for code generation, completion, infilling or an explanation in natural language.
Review the license: Check Meta's commercial license and acceptable use policy before production use.
Code Llama's Use Cases
- Code generation
- Code completion and infilling
- Coding assistant chat
- Python-specific development














