Text Classification
Transformers
Safetensors
GGUF
English
qwen3_5
image-text-to-text
tinyjev
jev
decision-model
system-one
typed-decisions
ollama
qwen3.5
conversational
Instructions to use AnkitAI/TinyJev-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AnkitAI/TinyJev-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="AnkitAI/TinyJev-4B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("AnkitAI/TinyJev-4B") model = AutoModelForMultimodalLM.from_pretrained("AnkitAI/TinyJev-4B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AnkitAI/TinyJev-4B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf AnkitAI/TinyJev-4B:Q4_K_M # Run inference directly in the terminal: llama cli -hf AnkitAI/TinyJev-4B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AnkitAI/TinyJev-4B:Q4_K_M # Run inference directly in the terminal: llama cli -hf AnkitAI/TinyJev-4B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf AnkitAI/TinyJev-4B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf AnkitAI/TinyJev-4B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf AnkitAI/TinyJev-4B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf AnkitAI/TinyJev-4B:Q4_K_M
Use Docker
docker model run hf.co/AnkitAI/TinyJev-4B:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use AnkitAI/TinyJev-4B with Ollama:
ollama run hf.co/AnkitAI/TinyJev-4B:Q4_K_M
- Unsloth Desktop
- Pi
How to use AnkitAI/TinyJev-4B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AnkitAI/TinyJev-4B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AnkitAI/TinyJev-4B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AnkitAI/TinyJev-4B with Docker Model Runner:
docker model run hf.co/AnkitAI/TinyJev-4B:Q4_K_M
- Lemonade
How to use AnkitAI/TinyJev-4B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AnkitAI/TinyJev-4B:Q4_K_M
Run and chat with the model
lemonade run user.TinyJev-4B-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use AnkitAI/TinyJev-4B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AnkitAI/TinyJev-4B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default AnkitAI/TinyJev-4B:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AnkitAI/TinyJev-4B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AnkitAI/TinyJev-4B:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "AnkitAI/TinyJev-4B:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: transformers
|
| 4 |
+
pipeline_tag: text-classification
|
| 5 |
+
base_model: Qwen/Qwen3-4B-Base
|
| 6 |
+
tags: [tinyjev, jev, decision-model, system-one, typed-decisions, mlx, qwen3]
|
| 7 |
+
language: [en]
|
| 8 |
+
datasets: [jaredpalmer/kev-suites]
|
| 9 |
+
---
|
| 10 |
+
|
| 11 |
+
<div align="center">
|
| 12 |
+
|
| 13 |
+
<img alt="TinyJev" src="https://raw.githubusercontent.com/ankit-aglawe/tinyjev/main/assets/tinyjev_header.png" width="620">
|
| 14 |
+
|
| 15 |
+
<p>Typed decisions, on your laptop, in one forward pass. The bigger one.</p>
|
| 16 |
+
|
| 17 |
+
<p>
|
| 18 |
+
<a href="https://pypi.org/project/tinyjev/"><img alt="PyPI" src="https://img.shields.io/pypi/v/tinyjev?label=pypi&color=E46412"></a>
|
| 19 |
+
<a href="https://pypi.org/project/tinyjev/"><img alt="Python" src="https://img.shields.io/badge/python-3.9%2B-E46412"></a>
|
| 20 |
+
<a href="https://github.com/ankit-aglawe/tinyjev"><img alt="GitHub" src="https://img.shields.io/badge/code-github-E46412?logo=github&logoColor=white"></a>
|
| 21 |
+
<a href="https://github.com/ankit-aglawe/tinyjev/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-MIT-E46412"></a>
|
| 22 |
+
</p>
|
| 23 |
+
|
| 24 |
+
<p>
|
| 25 |
+
<a href="https://github.com/ankit-aglawe/tinyjev">GitHub</a> ·
|
| 26 |
+
<a href="https://pypi.org/project/tinyjev/">PyPI</a> ·
|
| 27 |
+
<a href="https://huggingface.co/AnkitAI/tinyjev-0.6b">TinyJev 0.6B</a> ·
|
| 28 |
+
<a href="https://github.com/ankit-aglawe/tinyjev/tree/main/examples">Examples</a>
|
| 29 |
+
</p>
|
| 30 |
+
|
| 31 |
+
</div>
|
| 32 |
+
|
| 33 |
+
Send this model some state, a ticket or a record or a log line, plus questions with the answers you
|
| 34 |
+
will accept. It returns a probability for every option you offered. It cannot answer with anything
|
| 35 |
+
else, because it never generates text; it scores the options you gave it and stops.
|
| 36 |
+
|
| 37 |
+
TinyJev 4B is the same head and the same training data as TinyJev 0.6B on a Qwen3-4B-Base backbone.
|
| 38 |
+
It is the accurate one: 474 of 500 never-seen decisions against 440, and at confidence ≥ 0.85 it
|
| 39 |
+
answers 87% of the queue on its own at 99.1%. It costs 8 GB (4.5 GB at 8 bits) and about 630 ms per
|
| 40 |
+
decision on a base M1, seven times the 0.6B's.
|
| 41 |
+
|
| 42 |
+
- `Choice` picks one option from a list, with a probability for each.
|
| 43 |
+
- `Noul` measures whether a statement is true.
|
| 44 |
+
- `Score` places state on an ordered scale.
|
| 45 |
+
- Calibrated confidence (ECE 0.022), so a threshold means something and you can decide what to automate.
|
| 46 |
+
- A Python API, a local HTTP server, and a System One compatible endpoint.
|
| 47 |
+
|
| 48 |
+
## Models
|
| 49 |
+
|
| 50 |
+
Two models so far, same head, same training data, scored on the same 500 never-seen cases from 25
|
| 51 |
+
domains ([`benchmarks/opendecision`](https://github.com/ankit-aglawe/tinyjev/tree/main/benchmarks/opendecision), every case and probability logged).
|
| 52 |
+
Latency is a base M1 (16 GB) via MLX, one forward pass per case.
|
| 53 |
+
|
| 54 |
+
| Model | Params | OD-500 | Gate 0.85 | ms / case | Weights |
|
| 55 |
+
|---|---:|---:|---|---:|---|
|
| 56 |
+
| <img src="https://raw.githubusercontent.com/ankit-aglawe/tinyjev/main/assets/logos/tinyjev.png" width="18"> **TinyJev 0.6B** | 596M, 1.2 GB | 440 (88.0%) | 59% @ 98.0% | 85 | 🤗 [AnkitAI/tinyjev-0.6b](https://huggingface.co/AnkitAI/tinyjev-0.6b) |
|
| 57 |
+
| <img src="https://raw.githubusercontent.com/ankit-aglawe/tinyjev/main/assets/logos/tinyjev.png" width="18"> **TinyJev 4B** | 4.0B, 8.0 GB | 474 (94.8%) | 87% @ 99.1% | 628 | 🤗 [AnkitAI/tinyjev-4b](https://huggingface.co/AnkitAI/tinyjev-4b) |
|
| 58 |
+
|
| 59 |
+
OD-500 is correct answers out of 500. Gate 0.85 is the share of decisions answered on its own at
|
| 60 |
+
confidence ≥ 0.85, and how often those were right. Calibration (ECE 0.071 vs 0.022), coverage at 2%
|
| 61 |
+
error (63% vs 92%) and transfer-v4 dev (0.625 vs 0.762) are on the benchmark page. Load either with
|
| 62 |
+
`tinyjev.load("tinyjev-0.6b")` or `tinyjev.load("tinyjev-4b")`.
|
| 63 |
+
|
| 64 |
+
Both rows are fp16. Loading with `quantize=8` keeps the same weights in half the memory and changes
|
| 65 |
+
almost nothing: the 0.6B scores 440 at 90 ms, the 4B 473 at 845 ms, one answer in 500 different from
|
| 66 |
+
fp16. The gate is the number that matters in production; the rest of the queue goes to a person or a
|
| 67 |
+
bigger model. On the same 500: Kev-0.8B 463, Claude Opus 5.5 496, the same Qwen3-0.6B weights read
|
| 68 |
+
through letter logits with no head 354.
|
| 69 |
+
|
| 70 |
+
## Measured
|
| 71 |
+
|
| 72 |
+
On OpenDecision's Original Choice 500, a suite of 25 domains that was not in the training data, with the same 500 inputs for every model:
|
| 73 |
+
|
| 74 |
+
| Model | Correct / 500 | Handled alone at confidence ≥ 0.85 |
|
| 75 |
+
|---|---:|---:|
|
| 76 |
+
| Claude Opus 5.5 (cloud, self-reported probabilities) | 496 | 477 at 100.0% |
|
| 77 |
+
| **tinyjev-4b** (fp16) | **474** | **437 at 99.1%** |
|
| 78 |
+
| tinyjev-4b at `quantize=8` | 473 | 437 at 99.1% |
|
| 79 |
+
| Kev-0.8B (raw logits) | 463 | 186 at 100.0% |
|
| 80 |
+
| tinyjev-0.6b | 440 | 296 at 98.0% |
|
| 81 |
+
|
| 82 |
+
353/375 on dev, 121/125 on holdout, 95% CI 0.928–0.966, ECE 0.022, Brier 0.071, coverage at 2% error 92%.
|
| 83 |
+
On Kev's transfer-v4 dev it scores 0.762 against 0.625 for the 0.6B (Kev-4B, a full fine-tune, 0.790).
|
| 84 |
+
Every case, every probability, the coverage curves and all the baseline rows:
|
| 85 |
+
[benchmarks/opendecision](https://github.com/ankit-aglawe/tinyjev/tree/main/benchmarks/opendecision).
|
| 86 |
+
|
| 87 |
+
Known weakness, measured: statement-form yes/no checks. On a 21-item check list about one support
|
| 88 |
+
email it scores 18 (the 0.6B: 14, it says yes to everything); on hard negatives, statements about a
|
| 89 |
+
topic the text mentions but does not support, 81%. Training data for that is the next experiment.
|
| 90 |
+
|
| 91 |
+
## Use it
|
| 92 |
+
|
| 93 |
+
```bash
|
| 94 |
+
pip install 'tinyjev[mlx]' # Apple Silicon
|
| 95 |
+
pip install 'tinyjev[torch]' # everything else
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
```python
|
| 99 |
+
import tinyjev
|
| 100 |
+
agent = tinyjev.load("tinyjev-4b", quantize=8) # 4.5 GB in memory; drop quantize for fp16, 8 GB
|
| 101 |
+
|
| 102 |
+
agent.predict({
|
| 103 |
+
"state": "Shoes arrived two weeks late and in the wrong size. Also I see two charges on my card.",
|
| 104 |
+
"questions": {
|
| 105 |
+
"team": {"type": "choice", "instructions": "Which team should handle this?",
|
| 106 |
+
"criteria": {"returns": "Exchanges, refunds, wrong or damaged items",
|
| 107 |
+
"shipping": "Delivery status, delays, lost packages",
|
| 108 |
+
"billing": "Charges, invoices, payment problems"}},
|
| 109 |
+
"escalate": {"type": "noul", "instructions": "Does this need urgent human attention?"},
|
| 110 |
+
"anger": {"type": "score", "instructions": "How angry is the customer?",
|
| 111 |
+
"criteria": ["calm", "frustrated", "very angry"]},
|
| 112 |
+
}})
|
| 113 |
+
```
|
| 114 |
+
|
| 115 |
+
Eight bits changed one answer in 500 on the held-out suite. Serve it over HTTP, speaking the System
|
| 116 |
+
One request shape:
|
| 117 |
+
|
| 118 |
+
```bash
|
| 119 |
+
tinyjev serve tinyjev-4b --quantize 8 # POST /v1/systemone on 127.0.0.1:8077
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
## What is in this repo
|
| 123 |
+
|
| 124 |
+
`AutoModel.from_pretrained("AnkitAI/tinyjev-4b")` loads the backbone on its own, a standard
|
| 125 |
+
`Qwen3Model` in fp16 with the LoRA already merged. The decision head lives in `head.safetensors`, and
|
| 126 |
+
`tinyjev` is what turns hidden states into calibrated answers.
|
| 127 |
+
|
| 128 |
+
## How it was built, and how it scores
|
| 129 |
+
|
| 130 |
+
Qwen3-4B-Base with a pointer head, LoRA r16 at lr 5e-5, seed 2, two epochs on the public
|
| 131 |
+
`jaredpalmer/kev-suites` decision-v7 training split (12,576 records), Kev's study runner on one H100
|
| 132 |
+
for 45 minutes, the adapter merged back into the base. No held-out transfer source was used in
|
| 133 |
+
training. Temperature 1.0 at inference; the calibration figures above are at raw logits.
|
| 134 |
+
|
| 135 |
+
| | transfer-v4 dev | decision-v7 dev | OpenDecision 500 |
|
| 136 |
+
| --- | --- | --- | --- |
|
| 137 |
+
| tinyjev-4b | 0.762 | 0.859 | 474 / 500 |
|
| 138 |
+
| tinyjev-0.6b | 0.625 | | 440 / 500 |
|
| 139 |
+
|
| 140 |
+
## Support the Project
|
| 141 |
+
|
| 142 |
+
If this model is useful in your work, you can support independent research:
|
| 143 |
+
|
| 144 |
+
<p align="left">
|
| 145 |
+
<a href="https://www.buymeacoffee.com/AnkitAI" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me a Coffee" height="60" width="217" /></a>
|
| 146 |
+
</p>
|
| 147 |
+
|
| 148 |
+
## Credits
|
| 149 |
+
|
| 150 |
+
Built on [Qwen3-4B-Base](https://huggingface.co/Qwen/Qwen3-4B-Base) (Apache-2.0). The training data,
|
| 151 |
+
evaluation suites and the pointer-head design come from [Kev](https://github.com/jaredpalmer/kev) by
|
| 152 |
+
Jared Palmer (Apache-2.0). The typed-decision interface follows
|
| 153 |
+
[TypeSafe's Jev](https://docs.typesafe.ai/introduction). MIT licensed.
|