---
title: "LLMs-from-scratch vs CodeGen"
type: "comparison"
canonical_url: "https://www.graphcanon.com/compare/rasbt-llms-from-scratch-vs-salesforce-codegen"
tools: ["rasbt-llms-from-scratch", "salesforce-codegen"]
---

# LLMs-from-scratch vs CodeGen

*GraphCanon updated Jul 12, 2026*

## Verdict

Pick LLMs-from-scratch if lLMs-from-scratch is a project-oriented repository aimed at building PyTorch-based language models from the ground up, with detailed step-by-step instructions; pick CodeGen if codeGen is a series of open-source large language models designed for program synthesis. Trained on TPUs, CodeGen offers several versions with varying capabilities from basic code generation to advanced infill sampling.

[LLMs-from-scratch](https://amzn.to/4fqvn0D) reports 99k GitHub stars, 15k forks, and 4 open issues, last pushed Jun 2, 2026. [CodeGen](https://github.com/salesforce/CodeGen) has 5.2k stars, 423 forks, and 48 open issues, last pushed Jun 2, 2026. Figures are from public GitHub metadata via [LLMs-from-scratch's repository](https://github.com/rasbt/LLMs-from-scratch) and [CodeGen's repository](https://github.com/salesforce/CodeGen).

| | [LLMs-from-scratch](/tools/rasbt-llms-from-scratch.md) | [CodeGen](/tools/salesforce-codegen.md) |
| --- | --- | --- |
| Tagline | Implement a ChatGPT-like LLM in PyTorch from scratch, step by step | Family of open-source models for program synthesis. |
| Stars | 98,899 | 5,177 |
| Forks | 15,183 | 423 |
| Open issues | 4 | 48 |
| Language | Jupyter Notebook | Python |
| Adopt for | LLMs-from-scratch is a project-oriented repository aimed at building PyTorch-based language models from the ground up, with detailed step-by-step instructions. | CodeGen is a series of open-source large language models designed for program synthesis. Trained on TPUs, CodeGen offers several versions with varying capabilities from basic code generation to advanced infill sampling. |
| Persona | - | - |
| Runtime | - | - |
| License | Other | Apache-2.0 |
| Categories | LLM Frameworks, Model Training | LLM Frameworks, Model Training |

## Trust and health

_Sourced signals - not a safety guarantee. No winner column._

| | [LLMs-from-scratch](/tools/rasbt-llms-from-scratch.md) | [CodeGen](/tools/salesforce-codegen.md) |
| --- | --- | --- |
| Days since push | 38d | 39d |
| Open issues (now) | 4 | 48 |
| Owner type | User | Organization |
| Full report | [trust report](/tools/rasbt-llms-from-scratch/trust.md) | [trust report](/tools/salesforce-codegen/trust.md) |

## Decision facts: LLMs-from-scratch

- **Adopt for:** LLMs-from-scratch is a project-oriented repository aimed at building PyTorch-based language models from the ground up, with detailed step-by-step instructions.

## Decision facts: CodeGen

- **Adopt for:** CodeGen is a series of open-source large language models designed for program synthesis. Trained on TPUs, CodeGen offers several versions with varying capabilities from basic code generation to advanced infill sampling.

## Choose when

### Choose LLMs-from-scratch if…

- LLMs-from-scratch is primarily Jupyter Notebook; CodeGen is Python.
- License: LLMs-from-scratch is Other, CodeGen is Apache-2.0.
- Tags unique to LLMs-from-scratch: ai, artificial-intelligence, attention mechanism, deep-learning.
- - You are an advanced practitioner aiming to fully understand the underpinnings of LLMs using PyTorch as your primary framework.

### Choose CodeGen if…

- CodeGen is primarily Python; LLMs-from-scratch is Jupyter Notebook.
- License: CodeGen is Apache-2.0, LLMs-from-scratch is Other.
- Tags unique to CodeGen: codex, generativemodel, languagemodel, llm.
- When you require high-performance model training and code generation that matches or exceeds the performance of OpenAI Codex on specific tasks

## When NOT to use LLMs-from-scratch

- - If you are looking for a rapid deployment of an LLM without understanding its intricate structure - this tool requires extensive manual and conceptual work.
- - You prefer frameworks with automatic model generation or other high-level abstractions that simplify the process. This repository emphasizes manual creation, which is more time-consuming but offers丰
- a deeper learning experience.

## When NOT to use CodeGen

- In scenarios where the model's primary use is not centered around code generation or program synthesis, as its specialized training may limit its effectiveness for other types of generative tasks
- If your project strictly requires a smaller memory footprint or simpler deployment because advanced models like CodeGen2.5 require significant computational resources and setup

## Common questions

### What is the difference between LLMs-from-scratch and CodeGen?

LLMs-from-scratch: Implement a ChatGPT-like LLM in PyTorch from scratch, step by step. CodeGen: Family of open-source models for program synthesis.. See the comparison table for live GitHub stats and shared categories.

### When should I choose LLMs-from-scratch over CodeGen?

Choose LLMs-from-scratch over CodeGen when LLMs-from-scratch is primarily Jupyter Notebook; CodeGen is Python; License: LLMs-from-scratch is Other, CodeGen is Apache-2.0; Tags unique to LLMs-from-scratch: ai, artificial-intelligence, attention mechanism, deep-learning; - You are an advanced practitioner aiming to fully understand the underpinnings of LLMs using PyTorch as your primary framework.

### When should I choose CodeGen over LLMs-from-scratch?

Choose CodeGen over LLMs-from-scratch when CodeGen is primarily Python; LLMs-from-scratch is Jupyter Notebook; License: CodeGen is Apache-2.0, LLMs-from-scratch is Other; Tags unique to CodeGen: codex, generativemodel, languagemodel, llm; When you require high-performance model training and code generation that matches or exceeds the performance of OpenAI Codex on specific tasks.

### When should I avoid LLMs-from-scratch?

- If you are looking for a rapid deployment of an LLM without understanding its intricate structure - this tool requires extensive manual and conceptual work. - You prefer frameworks with automatic model generation or other high-level abstractions that simplify the process. This repository emphasizes manual creation, which is more time-consuming but offers丰 a deeper learning experience.

### When should I avoid CodeGen?

In scenarios where the model's primary use is not centered around code generation or program synthesis, as its specialized training may limit its effectiveness for other types of generative tasks If your project strictly requires a smaller memory footprint or simpler deployment because advanced models like CodeGen2.5 require significant computational resources and setup

### Is LLMs-from-scratch or CodeGen more popular on GitHub?

LLMs-from-scratch has more GitHub stars (98,899 vs 5,177). Stars measure visibility, not whether either tool fits your constraints.

### Are LLMs-from-scratch and CodeGen open source?

Yes - both are open-source projects on GitHub (LLMs-from-scratch: Other, CodeGen: Apache-2.0).

### Where can I find alternatives to LLMs-from-scratch or CodeGen?

GraphCanon lists graph-backed alternatives at [LLMs-from-scratch alternatives](/tools/rasbt-llms-from-scratch/alternatives) and [CodeGen alternatives](/tools/salesforce-codegen/alternatives) ([LLMs-from-scratch markdown twin](/tools/rasbt-llms-from-scratch/alternatives.md), [CodeGen markdown twin](/tools/salesforce-codegen/alternatives.md)), ranked by typed relationship edges rather than popularity votes.

### Is there a machine-readable version of this comparison?

Yes. The markdown twin at [this comparison](/compare/rasbt-llms-from-scratch-vs-salesforce-codegen.md) mirrors this page for agents and LLM crawlers, with the same stats table and FAQ answers.

### Which is better maintained, LLMs-from-scratch or CodeGen?

LLMs-from-scratch: Steady. CodeGen: Steady. Compare maintenance labels, days since push, and release cadence in the trust section below - stars alone do not measure maintenance.

### Where are the full trust reports for LLMs-from-scratch and CodeGen?

GraphCanon publishes per-repo trust reports with dated maintenance, provenance, and scan summaries: [LLMs-from-scratch trust report](/tools/rasbt-llms-from-scratch/trust); [CodeGen trust report](/tools/salesforce-codegen/trust).

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/graph?tool=rasbt-llms-from-scratch`](/api/graphcanon/graph?tool=rasbt-llms-from-scratch)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
