This release is a pre-release and may not be stable for production use.
Jeffy
Pretrained classifiers you can run and retrain on CPU — text, game state, or any numeric features.
jeffyclassify.com · Live Playground · GitHub
Try it
pip install jeffy-classify
jeffy-serve
Or try without installing (requires uv):
uvx --python 3.12 --from jeffy-classify jeffy-serve
Open http://localhost:8400, pick a classifier, and paste one of these:
| Classifier | Try this text |
|---|---|
| banking77 | I was charged twice for the same transaction |
| sms_spam | WINNER! You have been selected for a free cruise. Reply YES to claim. |
| ag_news | The Federal Reserve raised interest rates by 25 basis points on Wednesday |
Pretrained capabilities
68 classifiers ship with the package — 17 English/general-purpose and 51 multilingual intent classifiers covering languages from Afrikaans to Vietnamese. Weights are logistic regression coefficients (derived model parameters, not copies of training data). Source datasets and licenses are documented in ATTRIBUTION.md.
English / general-purpose
| Task | What it does | Classes | Test Acc | Test F1 |
|---|---|---|---|---|
| sms_spam | SMS spam detection | 2 | 99.1% | 98.0% |
| doom_fire | Doom game-state decisions (fire/turn) | 3 | 100.0% | 100.0% |
| fly_navigation | Drosophila connectome navigation | 3 | 98.0% | — |
| dbpedia | Wikipedia article category | 14 | 96.0% | 95.9% |
| imdb | Movie review sentiment (long text) | 2 | 94.8% | 94.8% |
| banking77 | Banking customer intent | 77 | 94.3% | 94.3% |
| ag_news | News topic (world/sports/business/tech) | 4 | 90.5% | 90.5% |
| sst2 | Movie review sentiment | 2 | 90.1% | 90.1% |
| poker_decision | Texas Hold'em poker decisions | 4 | 88.0% | — |
| clinc_oos | Voice assistant intent + out-of-scope | 151 | 88.4% | 92.1% |
| massive_intent | Smart home voice commands (English) | 60 | 88.1% | 86.4% |
| tweet_eval_offensive | Offensive language | 2 | 81.0% | 74.8% |
| tweet_eval_emotion | Tweet emotion | 4 | 78.1% | 74.7% |
| emotion | Text emotion (6 emotions) | 6 | 75.5% | 67.8% |
| inbox_router | Email inbox routing | 4 | 70.8% | 70.8% |
| tweet_eval_sentiment | Tweet sentiment (3-way) | 3 | 66.2% | 65.7% |
| snli | Natural language inference | 3 | 65.6% | 65.2% |
Multilingual (51 languages)
51 intent classifiers trained on Amazon MASSIVE — 60 voice-command intents per language, using frozen multilingual embeddings + per-language logistic regression. ~100 KB per classifier, no GPU needed.
With LaBSE embeddings (768-dim), mean accuracy is 83.3% across all 51 languages — only 1.8pp below fine-tuned XLM-R (85.1%). All languages above 70%, 47/51 above 80%.
| Tier | Languages | Accuracy range |
|---|---|---|
| Tier 1 (≥85%) | fr, en, ru, pl, fa, hu, sv, ja, hi | 85.1–86.5% |
| Tier 2 (80–85%) | pt, id, az, nl, ms, tr, da, es, ko, ro, fi, sl, zh_cn, sq, nb, it, lv, mn, af, de, el, vi, te, ml, he, bn, tl, is, ur, hy, kn, th, ta, am, my, zh_tw, cy, sw | 80.5–85.0% |
| Tier 3 (<80%) | jv, ka, ar, km | 76.4–78.8% |
Our encoder comparison found that mE5-small (118M params, 82.1% mean on 6 languages) outperforms MiniLM-L12 (118M params, 76.9%) at identical parameter count — training objective matters more than model size. See research for full results.
Test accuracy on held-out splits. Details in data/eval_results/benchmark.json. doom_fire and fly_navigation operate on numeric feature vectors instead of text — see examples/doom/ and examples/fly/. inbox_router is a demo classifier trained on 24 examples — see the live demo in the playground.
Weaknesses: SNLI (65.6%) and tweet_eval_sentiment (66.2%) are below what task-specific models achieve. Emotion (75.5%) has limited class coverage. Probabilities are uncalibrated.
Train a custom classifier
jeffy-train --example --save-dir my_models
Loaded 24 examples from reviews.csv
Training 'reviews': 24 examples, 2 classes
Split: 19 train, 5 test
Test accuracy: 100.0%
Saved to my_models/reviews/
--example uses a bundled 24-row product review CSV. To bring your own:
jeffy-train --input your_data.csv --text-col text --label-col label \
--task-id your_task --save-dir my_models
Supports .csv, .tsv, and .jsonl.
Serve a custom model
JEFFY_PACK_DIR=my_models jeffy-serve
curl -s -X POST http://localhost:8400/v1/predict \
-H "Content-Type: application/json" \
-d '{"text": "The battery life is amazing", "task": "reviews"}'
# → {"label": "positive", "confidence": 0.87, ...}
Install from source
git clone https://github.com/nicobrenner/jeffy.git
cd jeffy
# With uv (recommended)
uv venv && uv pip install -e .
# Or with pip
python -m venv .venv && source .venv/bin/activate
pip install -e .
The first prediction downloads the required encoder(s) — bge-large-en-v1.5 (~1.2 GB) for English tasks, paraphrase-multilingual-MiniLM-L12-v2 (~470 MB) for multilingual — cached afterward.
API
Python
from jeffy.engine import Engine
engine = Engine()
engine.load()
# List available classifiers
for name, cap in engine.capabilities.items():
print(f"{name}: {cap.description} ({cap.n_classes} classes)")
# Classify text
result = engine.predict("banking77", "I was charged twice for the same transaction")
print(result["label"]) # "transaction_charged_twice"
print(result["confidence"]) # 0.999
print(result["probabilities"]) # {"transaction_charged_twice": 0.999, ...}
SDK walkthrough
HTTP
# Banking intent
curl -s -X POST http://localhost:8400/v1/predict \
-H "Content-Type: application/json" \
-d '{"text": "I was charged twice for the same transaction", "task": "banking77"}'
# → {"label": "transaction_charged_twice", "confidence": 0.999, ...}
# Spam detection
curl -s -X POST http://localhost:8400/v1/predict \
-H "Content-Type: application/json" \
-d '{"text": "WINNER! You have been selected for a free cruise. Reply YES to claim.", "task": "sms_spam"}'
# → {"label": "spam", "confidence": 0.91, ...}
# News topic
curl -s -X POST http://localhost:8400/v1/predict \
-H "Content-Type: application/json" \
-d '{"text": "The Federal Reserve raised interest rates by 25 basis points on Wednesday", "task": "ag_news"}'
# → {"label": "Business", "confidence": 0.86, ...}
List capabilities
curl -s http://localhost:8400/v1/capabilities | python3 -c "
import json, sys
for c in json.load(sys.stdin)['capabilities']:
print(f\"{c['task_id']:25s} {c['n_classes']:3d} classes {c['test_accuracy']:.1%} {c['name']}\")"
Per-capability metadata
Each shipped classifier has a manifest.json with label names, source dataset, HuggingFace path, stated license, encoder identity, training/test counts, and integrity hashes.
curl -s http://localhost:8400/v1/capabilities/banking77 | python3 -m json.tool
Train from Python
from jeffy.train import train_classifier
clf = train_classifier(
texts=["great product!", "terrible service", "fast shipping", "broken on arrival"],
labels=["positive", "negative", "positive", "negative"],
task_id="my_reviews",
)
result = clf.predict("the quality exceeded my expectations")
print(result["label"]) # "positive"
clf.save("my_models")
Tuning options
| Parameter | Default | Description |
|---|---|---|
C |
0.01 | How aggressively the model fits your data. Low (0.001) = conservative, keeps predictions closer to "I'm not sure." High (1.0) = trusts individual training examples more. If the model is great on training data but bad on new data (overfitting), lower C. |
test_size |
0.2 | What fraction of your data to hold back for testing. With 100 examples at 0.2, it trains on 80 and tests on 20. Set to 0 to train on everything (useful when you have very little data and will test manually). |
cv_folds |
3 | Cross-validation: splits your training data into 3 parts, trains on 2 and tests on 1, rotates three times, averages the scores. Gives a more reliable accuracy estimate than a single split. Set to 0 to skip (faster, less reliable estimate). |
Start with the defaults. With <50 examples per class, expect noisy estimates.
Per-flag binary classifiers
When several yes/no flags can fire on the same input, train one binary head per flag instead of one multi-class head. Each flag gets its own decision boundary, which works better than a single model when flags are rare and independent.
from jeffy.train import train_binary_flags
flags = train_binary_flags(
texts=emails,
flags={
"legal_threat": ["no", "yes", "no", ...],
"vulnerable_person": ["no", "no", "yes", ...],
},
task_id="intake",
tune_C=True,
)
flags["legal_threat"].predict("I am contacting my solicitor") # {"label": "yes", ...}
Over HTTP, pass mode: "binary-flags" with texts and flags to POST /v1/train.
| Parameter | Default | Description |
|---|---|---|
class_weight |
"balanced" |
"balanced" reweights the rare positive class, which maximizes recall and is usually right for triage. Pass None for the unweighted fit: it raises far fewer flags at noticeably higher precision. On real data a balanced head raised roughly a third more flags than the reference labels did, so if a false positive is expensive, start with None. |
tune_C |
False |
Grid-search C per flag, scored by positive-class F1 on 2 or 3 stratified folds (fold count is clamped to the rarer class so no fold ends up with zero positives). |
tune_threshold |
False |
Also pick a per-flag decision threshold on a held-out dev slice, jointly with C. The chosen threshold is folded into the model's intercept, so it survives save() and needs no special handling at predict time. |
min_threshold_positives |
8 | Skip threshold tuning for any flag whose dev slice has fewer positives than this. Below roughly 8 the threshold fits noise. Since the dev slice is a quarter of the training data, this needs about 32 positives for that flag. |
Tuning is scored by positive-class F1, not macro F1. For a rare flag the "no" class scores near 1.0, so macro F1 is dominated by the easy class and can select a different C than the flag's own performance justifies.
Corrections on your own embeddings
If you run your own encoder and want Jeffy only for the heads, /v1/predict and /v1/feedback both take a features vector in place of text:
curl -X POST localhost:8400/v1/feedback \
-H "Content-Type: application/json" \
-d '{"task_id": "intake", "features": [0.12, -0.44, ...], "correct_label": "escalate"}'
Corrections accumulate and trigger a retrain at JEFFY_RETRAIN_THRESHOLD, using your vectors directly with no encoder in the loop. A given task_id has to stay all-text or all-features, since a retrain consumes every stored entry at once; mixing the two returns 409.
Server configuration
| Variable | Default | Description |
|---|---|---|
JEFFY_ENABLE_TRAINING |
unset (off) | Enables the /v1/train and /v1/feedback endpoints. They are off by default because they mutate server state and write files to disk. Leave disabled on any public or shared instance; both return 404 when off. |
JEFFY_TRAINED_DIR |
~/.jeffy/trained |
Where classifiers trained via /v1/train are written. Never the installed package directory. |
JEFFY_FEEDBACK_DIR |
~/.jeffy-feedback |
Where /v1/feedback corrections are stored as JSONL. |
JEFFY_RETRAIN_THRESHOLD |
50 | How many feedback corrections trigger an automatic retrain. |
JEFFY_PACK_DIR |
bundled pack | Directory of model pack artifacts to serve. |
JEFFY_DEVICE |
cpu |
Torch device for the encoder. |
JEFFY_BACKEND |
auto |
onnx, torch, or auto. |
JEFFY_NO_UPDATE_CHECK |
unset | Set to 1 to disable the update check described below. |
Update check
On startup the server checks PyPI once a day for a newer release and logs a single line if one exists:
Update available: 0.1.0a17 → 0.1.0a18 (pip install -U jeffy-classify)
It runs on a background thread, never delays startup, and fails silently if offline. The result is cached in ~/.jeffy/update_check.json. It sends no telemetry: the request is a plain GET of Jeffy's own public PyPI metadata, with nothing about you or your data attached. To turn it off entirely:
JEFFY_NO_UPDATE_CHECK=1 jeffy-serve
It is also skipped automatically when CI is set.
Reproduce the evaluation
# Install with build dependencies
uv pip install -e ".[build]"
# or: pip install -e ".[build]"
# Retrain all heads from source datasets (~40 min, downloads ~5 GB)
jeffy-build --out data/model_pack
# Evaluate on held-out test sets with tuned baselines
jeffy-evaluate --baselines --latency --device cpu
Evaluation notes
- SST-2: Evaluated on
validationsplit (official test labels are not public). - SMS Spam: Random split (test_size=0.2, seed=42); no standard benchmark split.
- SNLI: Input encoded as
premise [SEP] hypothesis. Label -1 filtered. - CLINC-OOS: 151 classes including out-of-scope. In-scope accuracy 96.5%, OOS detection 51.7%.
- MASSIVE: English head uses config
en. Multilingual heads cover 51 languages — see the multilingual table above.
Deployment
| Component | Size | Required for |
|---|---|---|
| Jeffy package (wheel) | ~6 MB | Always (includes all 68 classifiers) |
| Encoder (bge-large-en-v1.5) | ~1.2 GB | English tasks (downloaded on first use) |
| Encoder (paraphrase-multilingual-MiniLM-L12-v2) | ~470 MB | Multilingual tasks (downloaded on first use) |
datasets package |
~100 MB | Retraining from HuggingFace only |
Runtime memory: ~2 GB with English encoder, ~2.5 GB with both loaded. Encoders shared across all heads.
Latency (CPU, single example, Linux aarch64):
| Stage | p50 | Notes |
|---|---|---|
| Embedding | 50–80 ms | Dominates; varies with input length |
| Classifier | <1 ms | Negligible |
| Total | 50–80 ms | End-to-end |
Model security
Bundled pretrained artifacts use numpy .npz format (portable, no pickle). Custom-trained models also save a joblib pickle backup. Only load custom pickle artifacts from trusted sources. Each artifact's manifest.json includes integrity hashes verified on load.
Provenance and licensing
Jeffy code is MIT-licensed. Head artifacts are derived from public datasets; redistribution permissions have not been independently verified for all sources. See ATTRIBUTION.md for per-dataset license status.
| Dataset | Stated license |
|---|---|
| banking77, massive_intent, sms_spam | CC BY 4.0 |
| clinc_oos | CC BY 3.0 |
| dbpedia | CC BY-SA 3.0 |
| snli | CC BY-SA 4.0 |
| ag_news, imdb | Academic / non-commercial |
| sst2 | Stanford academic license |
| emotion | Academic |
| tweet_eval_* | Twitter TOS / academic |
The encoder (bge-large-en-v1.5) is MIT-licensed.
Tested
Verified with clean-environment wheel and sdist install on Linux aarch64, Python 3.12, scikit-learn 1.9+, sentence-transformers 6.1+, numpy 2.5+. Pretrained artifacts use numpy .npz format, avoiding sklearn version coupling.
What's not included
- No zero-shot / general classification. Each task needs a trained head. Unknown tasks return an error.
- No LLM fallback. This release is pure embedding + classifier.
- No automatic task routing. You must specify which classifier to use.
- No hosted service. Runs locally; playground.jeffyclassify.com is a demo, not a production API.
Roadmap
| Status | Milestone |
|---|---|
| Available | Pretrained classifier library (68 classifiers across 51 languages), SDK/API, custom training from CSV/JSONL |
| Available | PyPI package (pip install jeffy-classify), non-text classifiers (numeric feature vectors) |
| Available | Classifier catalog UI with model detail pages, live try-it forms, and usage snippets |
| Available | Live Doom demo — real-time VizDoom classifier streaming in the playground |
| Available | Inbox classifier demo — animated training + classification workflow |
| Available | Poker AI demo — 4 AI players streaming Texas Hold'em decisions live |
| Available | Landing page at jeffyclassify.com, live playground at playground.jeffyclassify.com |
| Available | Multilingual classifiers — 51 languages via frozen multilingual embeddings + per-language logistic regression (research) |
| Next | Live demos for more classifiers, broader catalog released in verified batches |
| Planned | Automatic routing among supported classifiers |
| Planned | Optional local/API LLM fallback for unsupported tasks |
| Planned | Hosted classifier catalog and decision-routing service |
| Planned | Embeddable preference recorder — a drop-in integration for web platforms that trains classifiers from live human decisions and contextual data, capturing expertise as reusable models |
| Exploring | Assisted labeling, retraining from corrections, classifier sharing |
Vote on what you want to see next → Comment on an issue or open a new one with your use case.
Metadata
Release files for jeffy-classify 0.1.0a19
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jeffy_classify-0.1.0a19.tar.gz | 30.8 MB | With provenance | Details for jeffy_classify-0.1.0a19.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jeffy_classify-0.1.0a19-py3-none-any.whl | Python 3 | none | any | Details for jeffy_classify-0.1.0a19-py3-none-any.whl |
Total release size: 40.4 MB
Release files / jeffy_classify-0.1.0a19.tar.gz
| Download URL | jeffy_classify-0.1.0a19.tar.gz |
|---|---|
| Size | 30.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a37ec6a6298e8f8afdf0108d3b59d71d4d8efa13e9fd725763b9f295364384b5
|
|
BLAKE2b-256 checksum How to use checksums |
15f4c76bb9551dfe48fe786c3658220ef40905911a5047efe49d3adb831a3659
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logRelease files / jeffy_classify-0.1.0a19-py3-none-any.whl
| Download URL | jeffy_classify-0.1.0a19-py3-none-any.whl |
|---|---|
| Size | 9.6 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca9a845a51a28d70a3cea5bc0b9d8587b87e93742822be8a94d9dd5377be44ac
|
|
BLAKE2b-256 checksum How to use checksums |
c94fdd2b471dad622e83cfc873187532a8950223b2f30b83b93230009b6e41b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logSecurity for jeffy-classify 0.1.0a19
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for jeffy_classify-0.1.0a19.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 25, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.