AndrewPrifer / jimothy
git clone https://github.com/AndrewPrifer/jimothy.git
—
+1
stars, 24h · #16,102
+~2
stars, 7 days · #25,171
+~10
stars, 30 days · #29,401
76
★ total · +2% this week
3
forks · 3 open issues
Star history (as recorded here)
LanguageTypeScript
LicenseMIT
Created2026-09-20 (1mo ago)
Last push1mo ago
Watchers0
OwnerUser
Links
- GitHub: github.com/AndrewPrifer/jimothy
- Homepage: https://jimothy-r63s.vercel.app
- Releases · Issues · Hacker News mentions
README excerpt
# Jimothy: Turn your Jev-usage into small, task-specific classifiers.
Train small, insanely fast local classifiers from Jev-compatible examples. Run locally in your browser or Node.js.
## Quick start
Requires Node.js 22 or later. Install and train a support-ticket classifier using the included examples:
[code]
This uses the default MiniLM backend, which downloads and bundles its pretrained encoder during training. Keep the entire output directory together when moving or deploying a model.
## CLI
For your own task, provide a task definition and dataset. Datasets accept JSONL or JSON arrays. Choose one training form:
[code]
The teacher form requires `AI_GATEWAY_API_KEY` in your environment and input rows such as `{"id":"1","state":"I was charged twice"}`. It sends inputs to the teacher and caches responses in ` .teacher/`; rerun the same command to resume. The other forms train locally from saved answers.
Training tunes regularization, calibrates probabilities, and recommends a cutoff. Add `--validation dev.jsonl` and `--test test.jsonl` for separate labeled evaluation sets; otherwise, training reserves a development split. Use `--backend tfidf` for a lightweight baseline or `--encoder path/to/encoder` to reuse MiniLM assets offline. Output directories must not already exist.
[code]
Prediction accepts exactly one of `--text`, `--state` (JSON), or `--data` (rows containing `state`). Results go to stdout as JSON; progress goes to stderr. File prediction emits one result per row. See the CLI reference for all options, encoder preparation, and custom teachers.
## Node.js SDK
[code]
States may be strings, JSON objects, or arrays; use the same shape as training. Answers support `choice`, `boolean`, `noul`, and `score`. Node inference needs no network access. Reuse a loaded model across predictions, then dispose it when finished.
`metadata.thresholdRecommendation` contains `{ threshold, status, targetAccuracy }`. A `null` threshold means no recommendation is available, as with the small quick-start dataset. The SDK returns every prediction; applying a cutoff is your application's choice. See SDK behavior and model bundles and automatic training.
## Browser SDK
Copy runtime assets and the complete trained model into your web app's public directory:
[code]
[code]
Serve over HTTPS or localhost; `public/` maps to `/` in these examples. The browser uses the same prediction methods and metadata as Node, with inference in a worker. TF-IDF runs in JavaScript; MiniLM defaults to q8 WASM. FP16 WebGPU requires a matching calibrated export. MiniLM probabilities can differ across runtimes, so validate cutoffs in your deployment environment.
The browser guide covers custom asset URLs, WebGPU, loading progress, cancellation, and plain HTML usage.
## Speed
Recorded on an Apple M3 Max with Node.js 25.6.0. Inference is warm, single-input median latency, excluding model loading:
| Workload | Local training, tuning and evaluation | Inference |
| --- | ---: | ---: