DEV.co
Open-Source LLM · Salesforce

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.

Source: HuggingFace — huggingface.co/Salesforce/codegen-350M-mono
Unknown
Parameters
bsd-3-clause
License (OSI-approved)
Unknown
Context (tokens)
148.6k
Downloads (30d)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
DeveloperSalesforce
ParametersUnknown
Context windowUnknown
Licensebsd-3-clause — OSI-approved
Modality / tasktext-generation
Gated on HuggingFaceNo
Downloads148.6k
Likes100
Last updated2025-01-31
SourceSalesforce/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.

Quickstart

Run codegen-350M-mono locally

Load the open weights with 🤗 Transformers and generate — the same model, self-hosted.

quickstart.pypython
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.

Deployment

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

Research prototyping in code generation

Lightweight baseline for academic research on program synthesis, particularly where smaller model size and inference speed are priorities over state-of-the-art accuracy.

Private/on-prem coding assistance

Self-hosted deployment in air-gapped or security-sensitive environments where model weights cannot leave your infrastructure; 350M parameters fit commodity GPU/CPU without large VRAM.

Python-focused code completion tools

IDE plugins or development tool integrations where Python code completion and snippet generation add value and model size/latency constraints exist.

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.

SignalAssessment
MaintenanceStale
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

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.

Software development agency

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.co

Related 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?
Yes. The BSD-3-Clause license explicitly permits commercial use, modification, and distribution. However, the model card advises evaluating accuracy, safety, and fairness before deploying to production, especially in high-risk scenarios (e.g., financial, medical, safety-critical code). Consult your legal and security teams before production deployment.
What hardware do I need to run this locally?
Estimated 1.4 GB RAM for float32, 700 MB for float16, or 350 MB for int8 quantization. Feasible on modest GPUs (RTX 3060, T4, A10) or modern CPUs (with quantization). Exact inference latency depends on hardware, batch size, and sequence length; unknown context length requires checking the model config.
How does accuracy compare to larger models or GPT-4?
Paper evaluates on HumanEval and MTPB benchmarks; refer to arXiv:2203.13474 for exact scores. 350M is substantially smaller and slower than CodeGen-6B/16B and commercial models (Codex, GPT-4). Use for research, prototyping, or latency-sensitive applications where perfect accuracy is not required.
Does this model support languages other than Python?
Not primarily. CodeGen-350M-Mono is specialized for Python after training on BigPython. Multi-language variants (CodeGen-Multi) exist but are not this checkpoint. Generalization to other languages is not documented; expect lower quality for Java, C++, JavaScript, etc.

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.