Finish your Python. Fix the small slips.
Hatchling is a very small neural network, written from scratch, that learned Python by reading examples. Paste some code and it will finish it, or find a missing colon, bracket or quote and repair it.
Type the start of some Python. Hatchling writes what comes next.
Paste code that won't run. Hatchling looks for small syntax mistakes: a missing colon, bracket or quote, a misspelled keyword, or wrong indentation.
Runs in your browser. Nothing you type here is sent to a server.
API
Everything above is available over HTTP. It is free to use, needs no key, and allows cross-origin requests, so you can call it from a web page, a script or a Scratch-style tool.
| Endpoint | Send | Get back |
|---|---|---|
POST /api/complete | code, optional max (1–48), temp (0–1.2) | completion, done |
POST /api/fix | code, optional from | code, edits, changed, done, next |
GET /api/info | nothing | version, limits, how it was trained |
Finish code
Fix code
Long inputs are checked in pieces to keep each request fast. If done is false, send the returned code again with from set to next. The JavaScript helper does this for you:
Limits: 6,000 characters of code per request. Teaching new examples is not part of the public API, so nobody can change what Hatchling knows.
About
Hatchling is not a large language model. It is a small neural network with about 92,000 numbers, written without any machine learning library, and taught on a few thousand lines of everyday Python.
What it is good at
Finishing short, common patterns like function definitions, loops, if statements and classes, and repairing a single missing or extra symbol on a line.
What it cannot do
It does not understand what your program is for, so it cannot find logic bugs, wrong results or bad variable choices. It only sees the 16 characters before each spot, so it forgets anything further back. Treat its fixes as suggestions and run your code.
How fixing works
For every character, Hatchling asks how surprised it is. Where it is very surprised, it tries a handful of small edits (add, remove or swap one symbol, fix the indentation, correct a misspelled keyword) and keeps one only if the code becomes clearly more likely. Names you chose yourself are left alone.