OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Models

Codegen

Codegen is an open-source family of language models for program synthesis, released with model checkpoints and Python examples for generating text from prompts. The repository covers CodeGen1, CodeGen2 and CodeGen2.5, and identifies infill sampling as a capability of CodeGen2.

Independent OpenViST project profile, based on linked sources.

Codegen — OpenViST project profile in AI Models.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Codegen when you need model checkpoints and documented Python examples as a starting point for code-generation research or application development, rather than a finished coding interface.

Who it is for

  • Developers exploring code-generation or program-synthesis applications.
  • Researchers who want to experiment with code-focused language models.
  • Teams investigating code completion, infill-based editing or model fine-tuning.

Documented uses

  • Load a CodeGen checkpoint and generate text from a prompt.
  • Explore infill sampling for code-editing experiments.
  • Preprocess data or train and fine-tune CodeGen models using the separately referenced Jaxformer library.
Before you choose

Requirements & limits

The models are linked through the Hugging Face Hub. The public GitHub repository is licensed under Apache-2.0.

  • The release spans multiple model sizes, so checkpoint choice affects the scale of the model being explored.
  • The repository describes CodeGen2 as having strong infill-sampling capability, relevant to code-editing experiments.
  • The examples use PyTorch and Hugging Face Transformers; some include the trust_remote_code setting.
  • The maintainers describe the release as research-oriented and recommend assessing downstream accuracy, safety and fairness.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Load a CodeGen checkpoint and generate text

Use the repository’s Python example to load a model and tokenizer, generate text from a prompt, and decode the output.

Before you start

  • Python
  • PyTorch
  • Hugging Face Transformers
  • A CodeGen checkpoint available through the Hugging Face Hub

Steps

  1. Import PyTorch and the Transformers AutoTokenizer and AutoModelForCausalLM classes.

  2. Load the tokenizer and model using a checkpoint identifier shown in the repository.

  3. Tokenize a prompt and pass the resulting inputs to the model’s generate method.

  4. Decode the generated tokens into text.

Expected outcome

Generated text decoded from a prompt, as shown in the repository’s example.

Guide limitations

  • The examples do not establish hardware requirements or guarantee compatibility.
  • The repository says the release is for research and recommends evaluating model accuracy, safety and fairness for downstream uses.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
7 October 2026
Original website title
salesforce/CodeGen · Official homepage title · retained in its source language