codegen-350M-mono
CodeGen-350M-Mono is a 350-million-parameter autoregressive language model from Salesforce designed for program synthesis—generating executable code from English descriptions. It's a smaller, Python-specialized variant initialized from CodeGen-Multi and fine-tuned on 71.7B tokens of Python code. The model is open-source under BSD-3-Clause, ungated, and suitable for research and self-hosted deployments where model size and inference cost matter.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Developer | Salesforce |
| Parameters | Unknown |
| Context window | Unknown |
| License | bsd-3-clause — OSI-approved |
| Modality / task | text-generation |
| Gated on HuggingFace | No |
| Downloads | 148.6k |
| Likes | 100 |
| Last updated | 2025-01-31 |
| Source | Salesforce/codegen-350M-mono |
What codegen-350M-mono is
CodeGen-350M-Mono is a causal language model (autoregressive text-generation pipeline) trained on BigPython dataset after initialization from CodeGen-Multi 350M. Architecture details and exact context length are not disclosed. Trained via cross-entropy loss on TPU-v4-512 clusters. Evaluated on HumanEval and MTPB benchmarks (refer to paper for results). Compatible with Hugging Face transformers library, PyTorch, and supports Azure deployment. Last modified January 2025.
Run codegen-350M-mono locally
Load the open weights with 🤗 Transformers and generate — the same model, self-hosted.
from transformers import pipelinepipe = pipeline("text-generation", model="Salesforce/codegen-350M-mono")out = pipe("Explain retrieval-augmented generation in one sentence.", max_new_tokens=128)print(out[0]["generated_text"])Swap in vLLM or Ollama for production-grade serving. DEV.co can stand up the inference stack.
How you'd run it
A typical self-hosted path — open weights, an inference server, your application.
DEV.co builds each layer — from GPU infrastructure to the application.
Best use cases
Running & fine-tuning it
ESTIMATE: 350M parameters typically requires ~1.4 GB in float32 (4× parameters), ~700 MB in float16, or ~350 MB in int8 quantization. Inference on modest GPUs (e.g., RTX 3060, A10, T4) or CPU feasible depending on latency tolerance. Context length unknown; verify against PyTorch model config. Training would require multi-GPU setup; inference is primary use case.
LoRA/QLoRA fine-tuning is plausible given 350M parameter count and Hugging Face transformer compatibility. Model card does not document fine-tuning recipes, learning rates, or data requirements. BigPython dataset details in paper Section 2.1; custom Python datasets can be used. Quantization (int8, int4) recommended for on-device fine-tuning to reduce memory footprint.
When to avoid it — and what to weigh
- Production code safety is critical — Model card explicitly states intended use is research only and advises evaluation of accuracy and safety before deployment, especially in high-risk scenarios. No security audit or production hardening is documented.
- You need state-of-the-art code generation accuracy — 350M parameters is significantly smaller than larger CodeGen variants (2B, 6B, 16B) or modern alternatives. Benchmark results favor larger models; refer to paper for quantitative comparison.
- Multi-language code generation required — Model is specialized for Python (Mono variant); it was trained primarily on Python code. Generalization to other languages is not documented or evaluated.
- High-throughput inference without infrastructure investment — Requires self-hosting (GPU/TPU or CPU) and inference optimization (vLLM, TGI, etc.). No managed API endpoint provided; Azure deployment tags suggest custom setup.
License & commercial use
BSD-3-Clause (OSI-approved permissive license). Allows commercial and proprietary use, modification, and distribution provided original license and copyright notice are included in source and binary distributions. No copyleft restrictions.
BSD-3-Clause is a permissive OSI license that explicitly permits commercial use. However, the model card states release is 'for research purposes only' and recommends evaluation of accuracy, safety, and fairness before deployment. This is an ethical/procedural caveat, not a legal restriction. Commercial use of the model weights is legally permitted under BSD-3-Clause, but Salesforce strongly recommends pre-deployment safety review, particularly for high-risk scenarios. Consult your legal team if deploying to production systems affecting user safety, rights, or financial outcomes.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Stale |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
Model card does not address security evaluation, adversarial robustness, or code injection risks. As a code-generation model, it can produce executable code; no guarantees on output safety, correctness, or absence of security flaws. Generated code should be reviewed before execution. No documentation of data sanitization, prompt injection defenses, or filtering of biased/malicious patterns. Self-hosting eliminates data transmission risk but places security responsibility on operator.
Alternatives to consider
CodeGen-2B/6B/16B (Salesforce, same project)
Larger variants of same model family offering improved accuracy on HumanEval/MTPB; trade-off is VRAM and latency. Use if inference resources available and accuracy is prioritized.
OpenAI Codex / GPT-4 Code Interpreter (closed, API-only)
State-of-the-art code generation with multi-language support and production safety practices; requires API calls and commercial licensing. Use if accuracy and vendor support justify cost and data transmission.
Meta Code Llama (open-source, Llama 2 family)
Larger, multi-language code model with competitive HumanEval scores; Llama 2 community license permits commercial use under restrictions. Better general-purpose alternative if you need scale and multi-language support.
Ship codegen-350M-mono with senior software developers
Start with a private LLM deployment or build a custom coding assistant. Verify model accuracy and safety for your use case before production. Consult Devco's AI engineering team to design inference infrastructure, fine-tuning pipelines, or cost-optimized quantization strategies.
Talk to DEV.coRelated open-source tools
Surfaced by semantic similarity across the DEV.co open-source index.
Related on DEV.co
Explore the category and the services that help you build with it.
codegen-350M-mono FAQ
Can I use this model commercially?
What hardware do I need to run this locally?
How does accuracy compare to larger models or GPT-4?
Does this model support languages other than Python?
Custom software development services
DEV.co is a software development agency delivering custom software development services to companies building on open source. Our software developers and web developers design, integrate, and ship production systems — spanning web development, APIs, AI, data, and cloud. If codegen-350M-mono is part of your open-source llms roadmap, our team can implement, customize, migrate, and maintain it.
Ready to Deploy CodeGen-350M-Mono?
Start with a private LLM deployment or build a custom coding assistant. Verify model accuracy and safety for your use case before production. Consult Devco's AI engineering team to design inference infrastructure, fine-tuning pipelines, or cost-optimized quantization strategies.