Field noteNov 27, 20263 min read1 source

Train a small GPT on a Hugging Face GPU, without changing your code

The repository trains a 51M-parameter GPT-style model on TinyStories and includes run_on_hf.sh, which its README says can be copied into other projects—not just this one.

In one minute

The repository trains a 51M-parameter GPT-style model on TinyStories and includes runonhf.sh, which its README says can be copied into other projects—not just this one. (github.com)

What happened

TinyStories is described as two million short stories for young children. The example script runs unchanged on a Mac, NVIDIA GPU or CPU. (github.com) For a remote job, the wrapper copies the project folder to a private Hub storage bucket, excluding hidden files and folders, __pycache__ and out/; it installs requirements.txt and invokes the script with the same command used locally. (github.com) It links the job's out/ directory to the bucket so outputs persist after the job machine is deleted. The training script saves out/model.pt, prints loss, speed and estimated time remaining every 100 steps, and emits a generated story every 2,000 steps. (github.com) A separate sample.py script generates stories with the trained model. The job runs in the background, and the wrapper prints its ID. (github.com)

The README reports about 12 hours on an M4 Pro MacBook Pro versus about 30 minutes on an A100 through Hugging Face Jobs, and describes the A100 run as costing $1. (github.com) These are repository-reported figures, not benchmarks established here.

What the archive adds

This sits alongside earlier Hugging Face Jobs fine-tuning coverage: the focus here is a minimal path for running a training script remotely.

Why it matters

For another project, the wrapper can work without changing the training command if the script's dependencies are in requirements.txt, its outputs go to out/ (or you change the wrapper's OUT line), and its data is downloaded from the Hub or a URL. Only code is sent to the job, so local-only datasets will not arrive with it.

Limits and uncertainty

The runtime and cost numbers are stated in the repository README and are not independently measured here. (github.com)

Skill to build now

For local execution, use uv run --with-requirements requirements.txt train.py. (github.com) Remote GPU use requires a Hugging Face account with a PRO subscription or credits; log in with hf auth login. (github.com) Then launch an A100 job, with a two-hour maximum runtime, using ./run_on_hf.sh train.py a100-large. Another example is ./run_on_hf.sh train.py l4x1 4h. (github.com) There is no default GPU flavor; hf jobs hardware lists flavors and prices. (github.com) Follow progress with hf jobs logs -f <job id>. (github.com)

Reader takeaway

The useful part is the wrapper: it packages project code, installs requirements and preserves outputs in a Hub bucket while running the same script remotely. It is reusable, but data must be fetched from the Hub or a URL, and results need to land in out/ unless you edit the wrapper.

How this was made

First seen
Nov 27, 2026, 19:21 UTC in our intake.
Sources
1 source carried the story when we picked it up; we cite the original.
Written by
gpt-6-luna (AI model).
Critic
No separate critic model on this desk; the automated checks below gate publication.
Checks passed
The cited primary source was fetched and verified; the source is not older than 30 days; no earlier note covers the same story; the copy passed the site's structure and language checks.
Confidence
Editorial value: medium.
Human review
Published without a per-item human sign-off. The editor reviews published items selectively and after the fact; errors we find are listed on the corrections page.

Corrections and error statistics

Evidence / sources

  1. 1github.com/scienceetonnante/nanogpt-jobs
All Field Notes

Next reads

Read next

Open the graph
  1. 01topicComputeExplore the compute topic hub.
  2. 02topicDeveloper ToolsExplore the developer-tools topic hub.
  3. 03topicModelsExplore the models topic hub.
  4. 04archiveField NotesOpen the latest editorial analysis.
  5. 05sourcesSourcesSee the original sources this archive cites.
Who read this page?Machine requests, hidden until opened

Loading the privacy-safe route aggregate...

Open the JSON contract