Model reference · open weights
CoDA is an open-weight language model from Salesforce. CoDA-v0-Base (FP32) weighs 4.1 GB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the Salesforce/CoDA-v0-Base model card, 2026-10-01
What it is
| Released by | Salesforce |
|---|---|
| Released | 2025-09-25 |
| Parameters | 2.0B |
| VRAM | 4.1 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 7 | 1 | all 40K | 11.6 GB |
| RTX 4060 Ti 16 GB | 11 | 2 | all 40K | 15.4 GB |
| RTX 3090 24 GB | 19 | 4 | all 40K | 23.4 GB |
| RTX 4090 24 GB | 19 | 4 | all 40K | 23.4 GB |
| RTX 5090 32 GB | 27 | 6 | all 40K | 31.0 GB |
| L40S 48 GB | 41 | 10 | all 40K | 44.0 GB |
| A100 80 GB | 78 | 19 | all 40K | 78.2 GB |
| H100 80 GB | 73 | 18 | all 40K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 90 | 22 | all 40K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 104 | 26 | all 40K | 107 GB |
| H200 141 GB | 137 | 34 | all 40K | 138 GB |
| B200 180 GB | 177 | 44 | all 40K | 176 GB |
| 2× RTX 3060 12 GB tensor parallel | 18 | 4 | all 40K | 11.6 GB a card |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 5.7 GB | 8.5 GB |
| 5 | 9.4 GB | 23.5 GB |
| 8 | 12.2 GB | 34.8 GB |
| 16 | 19.8 GB | 64.9 GB |
| 32 | 34.8 GB | 125 GB |
| 64 | 64.9 GB | 245 GB |
One card, with vLLM's small-card settings.
From the model card
Welcome to CoDA, Salesforce AI Research's diffusion-based language model designed for powerful code generation and bidirectional context understanding.
We're releasing CoDA as a lightweight yet capable model:
CoDA-1.7B-Base — diffusion foundation model with bidirectional diffusion architecture, ideal for further fine-tuning and RL trainingCoDA-1.7B-Instruct — optimized for code generation tasks with bidirectional diffusion modeling (1.7B parameters)CoDA leverages discrete diffusion processes to enable understanding of both past and future tokens, making it uniquely suited for code completion and generation tasks where context flows in both directions.
[!NOTE] This model card is dedicated to the
CoDA-1.7B-Basemodel. Check out our model collection for other variants.
CoDA-1.7B-Instruct demonstrates competitive performance on standard code generation benchmarks:
| Model | HumanEval | HumanEval+ | MBPP | MBPP+ | EvalPlus |
|---|---|---|---|---|---|
| CoDA-Base | 29.3 | 23.8 | 35.2 | 46.0 | 34.9 |
| CoDA-Instruct | 54.3 | 47.6 | 47.2 | 63.2 | 55.4 |
| Dream-Base | 56.7 | 50.0 | 68.7 | 57.4 | 53.7 |
| Dream-7B-Instruct | 57.9 | 53.7 | 68.3 | 56.1 | 54.9 |
| LLaDA-8B-Instruct | 35.4 | 31.7 | 31.5 | 28.6 | 30.2 |
🎯 Key Finding: CoDA-1.7B-Instruct matches or surpasses diffusion models up to 7B parameters while maintaining significantly lower computational requirements. CoDA offers an advantageous balance between inference speed and accuracy compared to larger diffusion models.
CoDA employs a three-stage training process:
Three-stage training: (1) Pre-training with bidirectional masking, (2) Post-training with instruction format, (3) Inference with progressive denoising.
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "Salesforce/CoDA-v0-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Generate code
prompt = "Write a Python function to calculate fibonacci numbers"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
**inputs,
max_tokens=256,
diffusion_steps=128,
temperature=0.0
)
print(tokenizer.decode(outputs[0]))
For production deployment, we provide serving with OpenAI-compatible APIs:
# Clone the repository
git clone https://github.com/SalesforceAIResearch/CoDA
cd CoDA
# Set up environment
python3 -m venv .venv
source .venv/bin/activate
pip install -r serving/requirements.txt
# Export your Hugging Face token
export HF_TOKEN="hf_..."
# Start the server
bash serving/fast-api/start_server.sh
The server will listen on http://localhost:8000.
python serving/fast-api/chat_cli.py \
--base-url http://localhost:8000 \
--model Salesforce/CoDA-v0-Instruct \
--stream \
--show-meta
Customize generation behavior with environment variables:
export MAX_TOKENS=512 # Maximum tokens to generate
export TEMPERATURE=0.7 # Sampling temperature
export TOP_P=0.9 # Nucleus sampling threshold
export STEPS=128 # Number of diffusion steps
export ALG="entropy" # Sampling algorithm
export ALG_TEMP=0.1 # Algorithm temperature
export BLOCK_LENGTH=32 # Block size for processing
Recommended Settings:
STEPS=64, TEMPERATURE=0.0STEPS=128, TEMPERATURE=0.7, TOP_P=0.9STEPS=256, TEMPERATURE=0.5, TOP_P=0.95The complete training pipeline is available in our repository:
# Clone the repository
git clone https://github.com/SalesforceAIResearch/CoDA
cd CoDA
# Configure TPU environment
cd pre-train
cp env.example .env # Add your TPU metadata
bash setup_tpu.sh
# Launch pre-training
bash recipes/midtrain_v4_512.sh
# Set up fine-tuning environment
cd post-train/LLaMA-Factory
pip install -r requirements.txt
# Configure dataset and run fine-tuning
bash ../../run_sft.sh
cd evaluation/lm_eval
bash eval_mbpp_humaneval.sh
Technical report coming soon. F
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.