🚀 Code Llama
Code Llama is a collection of pretrained and fine - tuned generative text models with parameter scales ranging from 7 billion to 34 billion. This repository is for the 13B Python specialist version in the Hugging Face Transformers format. It is designed 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.
✨ Features
- Code Llama consists of models with different parameter scales (7B, 13B, 34B, 70B) and three variants (base, Python, Instruct).
- It is designed for general code synthesis and understanding, with specific variants for Python programming and instruction - following.
- The model uses an optimized transformer architecture for text generation.
📦 Installation
To use this model, please make sure to install transformers:
pip install https://github.com/huggingface/transformers accelerate
📚 Documentation
Model Capabilities
- [x] Code completion.
- [ ] Infilling.
- [ ] Instructions / chat.
- [x] Python specialist.
Model Details
Property |
Details |
Model Developers |
Meta |
Variations |
Code Llama comes in three model sizes (7B, 13B, 34B) and three variants: base for general code, Python - specific, and Instruct for instruction following. |
This Repository |
Contains the Python version of the 13B parameters model. |
Input |
Models input text only. |
Output |
Models generate text only. |
Model Architecture |
An auto - regressive language model using an optimized transformer architecture. |
Model Dates |
Trained between January 2023 and July 2023. |
Status |
A static model trained on an offline dataset. Future versions of Code Llama - Instruct will be released with improved safety. |
License |
A custom commercial license is available at: https://ai.meta.com/resources/models-and-libraries/llama-downloads/ |
Research Paper |
More information can be found in the paper "Code Llama: Open Foundation Models for Code" or its arXiv page. |
Intended Use
Intended Use Cases
Code Llama and its variants are intended 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 for safer code assistant and generation applications.
Out - of - Scope Uses
Use in any manner that violates applicable laws or regulations (including trade compliance laws), use in languages other than English, and use 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 were performed on Meta’s Research Super Cluster.
Carbon Footprint
Training all 9 Code Llama models required 400K GPU hours of computation on A100 - 80GB hardware. Estimated total emissions were 65.3 tCO2eq, 100% offset by Meta’s sustainability program.
Training Data
All experiments and released models were trained and fine - tuned using the same data as Llama 2 with different weights. See Section 2 and Table 1 in the research paper for details.
Evaluation Results
See evaluations for the main models and detailed ablations in Section 3 and safety evaluations in Section 4 of the research paper.
Ethical Considerations and Limitations
Code Llama and its variants are new technologies with risks. Testing has been in English and may not cover all scenarios. The model's outputs cannot be fully predicted, and it may produce inaccurate or objectionable responses. Developers should perform safety testing and tuning before deployment.
Please see the Responsible Use Guide available at https://ai.meta.com/llama/responsible-use-guide.
Model Variants Table