🚀 Code Llama
Code Llama is a set of pretrained and fine - tuned generative text models with parameter scales ranging from 7 billion to 70 billion. This repository hosts the 70B Python specialist version in the Hugging Face Transformers format. The model is crafted for general code synthesis and understanding. Links to other models can be found in the index at the bottom.
⚠️ Important Note
This is a non - official Code Llama repo. You can find the official Meta repository in the Meta Llama organization.
🚀 Quick Start
To use this model, you need to install transformers
.
pip install transformers accelerate
✨ Features
Property |
Details |
Model Type |
Code Llama comes in four model sizes (7B, 13B, 34B, 70B) and three variants: base model for general code synthesis and understanding, Python - specific model, and Instruct model for instruction following and safer deployment. This repo contains the 70B Python version. |
Training Data |
Trained between January 2023 and January 2024 using custom training libraries on Meta’s Research Super Cluster. |
Input |
The models only accept text as input. |
Output |
The models only generate text. |
Model Architecture |
An auto - regressive language model using an optimized transformer architecture, fine - tuned with up to 16k tokens. This variant does not support a long context of up to 100k tokens. |
Status |
A static model trained on an offline dataset. Future versions of Code Llama - Instruct will be released as model safety is improved with community feedback. |
Model Capabilities
- [x] Code completion.
- [ ] Infilling.
- [ ] Instructions / chat.
- [x] Python specialist.
📚 Documentation
Intended Use
Intended Use Cases
Code Llama and its variants are for commercial and research use in English and relevant programming languages. The base model can be adapted for various code synthesis and understanding tasks. The Python variant is for Python programming, and the Instruct variant is safer for code assistant and generation applications.
Out - of - Scope Uses
Using the model in any way that violates applicable laws or regulations (including trade compliance laws), in languages other than English, or in any way prohibited by the Acceptable Use Policy and Licensing Agreement.
Hardware and Software
Training Factors
Custom training libraries were used, and the training and fine - tuning of the released models were performed on Meta’s Research Super Cluster.
Carbon Footprint
Training all 12 Code Llama models required 1400K GPU hours of computation on A100 - 80GB hardware (TDP of 350 - 400W). The estimated total emissions were 228.55 tCO2eq, 100% offset by Meta’s sustainability program.
Evaluation Results
Refer to the evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper "Code Llama: Open Foundation Models for Code" or its arXiv page.
Ethical Considerations and Limitations
Code Llama and its variants are new technologies with risks. Testing has been in English and cannot cover all scenarios. As with all LLMs, the model's potential outputs cannot be predicted in advance, and it may produce inaccurate or objectionable responses. Developers should perform safety testing and tuning for their specific applications before deployment. See the Responsible Use Guide at https://ai.meta.com/llama/responsible-use-guide.
📄 License
A custom commercial license is available at: https://ai.meta.com/resources/models-and-libraries/llama-downloads/
Model Index