Using CodeLlama 70B Python on Replicate API
Implementation guide · Code Llama · AI at Meta
Replicate API exposes CodeLlama 70B Python through model ID meta/codellama-70b-python. Use the setup steps, sourced pricing, capabilities, and official provider links below to validate this route before deployment.
Last refreshed 2026-07-09. Next refresh: weekly.
Quick Start
- 1
- 2Use the Replicate API SDK or REST API to call
meta/codellama-70b-python— see the documentation for request format. - 3
Code Examples
pip install replicateREPLICATE_API_TOKENmeta/codellama-70b-pythonReplicate uses "owner/model-name" format (e.g. "meta/meta-llama-3-8b-instruct") for the latest version, or "owner/model-name:version-sha" to pin to a specific version. The REST endpoint splits owner and model-name into the path: /v1/models/{owner}/{model-name}/predictions.
import replicate
# reads REPLICATE_API_TOKEN from env
# meta/codellama-70b-python format: "owner/model-name" (latest version) or "owner/model-name:version-hash"
output = replicate.run(
"meta/codellama-70b-python",
input={"prompt": "Hello"}
)
# Output is a list or generator depending on the model
print("".join(output))Pricing on Replicate API
| Type | Price (per 1M) |
|---|---|
| Input tokens | $0.65 |
| Output tokens | $2.75 |
Capabilities
About CodeLlama 70B Python
CodeLlama 70B Python is a specialized AI model by Meta, designed for Python code synthesis and understanding. With 70 billion parameters, it excels in code completion, infilling, and instruction following tasks. The model leverages an optimized transformer architecture and has been fine-tuned with up to 16,000 tokens, making it particularly effective for Python-centric development workflows. While it doesn't support long contexts of 100,000 tokens, it offers powerful capabilities for both commercial and research applications in Python programming environments. More details can be found in the research paper "Code Llama: Open Foundation Models for Code" .