DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to train a GPT-2 class chat model end to end and talk to it with Nanochat

Set up the environment, run the speedrun script, then chat with your model in the CLI.

Short answer: Run uv sync --extra gpu for CUDA; then run source .venv/bin/activate; run bash runs/speedrun.sh, ideally in a screen session. All steps.

  • Top pick
  • Research
  • Advanced
  • 2 hours
  • From the README
  • Claude Code
  • Codex

platform. GPUs with less than 80GB may run out of VRAM; reduce --device-batch-size until it fits.

Who it is forAn ML engineer who wants to see the full LLM pipeline on one GPU node.

The problemFull LLM training stacks are large and hard to follow from tokenizer to chat.

The outcomeYour own trained model you can chat with over the CLI after about 1.5 to 2 hours on 8XH100.

What you need first

  • uv
  • An 8XH100 or 8XA100 node for the speedrun (a single GPU works, 8 times slower)
  • CPU or Apple Silicon only for the tiny runcpu example

Steps

  1. Run uv sync --extra gpu for CUDA
  2. Run source .venv/bin/activate
  3. Run bash runs/speedrun.sh, ideally in a screen session
  4. Run python -m scripts.chat_cli to talk to the model

Prompt for your agent

On this 8-GPU node, set up karpathy/nanochat with `uv sync --extra gpu`, run `bash runs/speedrun.sh` in a screen session, and when it finishes start `python -m scripts.chat_cli`.

Caveat. Cloud GPU time costs money; the README puts the GPT-2 run at about $48, closer to $15 on a spot instance.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for karpathy/nanochat and "Train a GPT-2 class chat model end to end and talk to it"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer