Text Generation
Transformers
Safetensors
English
k2_horizon
decision-model
jev
classification
calibration
pointer-head
conversational
custom_code
Instructions to use IFM/K2-Type-0.9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use IFM/K2-Type-0.9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="IFM/K2-Type-0.9B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("IFM/K2-Type-0.9B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use IFM/K2-Type-0.9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "IFM/K2-Type-0.9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Type-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/IFM/K2-Type-0.9B
- SGLang
How to use IFM/K2-Type-0.9B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "IFM/K2-Type-0.9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Type-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "IFM/K2-Type-0.9B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "IFM/K2-Type-0.9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use IFM/K2-Type-0.9B with Docker Model Runner:
docker model run hf.co/IFM/K2-Type-0.9B
File size: 4,934 Bytes
0648c43 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | ---
license: apache-2.0
base_model: IFM/K2-Horizon-0.9B
language:
- en
tags:
- decision-model
- jev
- classification
- calibration
- pointer-head
library_name: transformers
---
# K2-Type-0.9B
A 0.9B decision model in the style of TypeSafe's Jev (K2-Horizon-0.9B backbone; 1.08B parameters stored, including the base model's unused language-model head). You send one **state** (text or JSON) and any number of typed
**questions**; it returns a probability for every option of every question from **one forward pass**. It never
generates text.
| Question type | You give | You get |
| --- | --- | --- |
| `noul` | a statement, optional definitions of `false` / `true` | P(true) |
| `choice` | 1-255 named options with optional descriptions | the best option, its confidence, all probabilities |
| `score` | 2-255 ordered levels | expected level, probability per level |
Questions share the state but cannot see each other (block-causal attention mask), so adding a question never changes
another's answer. Built on [IFM/K2-Horizon-0.9B](https://huggingface.co/IFM/K2-Horizon-0.9B).
## Results
**JevBench public set** (231 items, [jevbench](https://github.com/fstandhartinger/jevbench) commit 26eb72d,
`typesafe` adapter against this repo's server, one H200, no network):
| Tier | Correct |
| --- | --- |
| standard (72, `original.jsonl`) | 66 |
| easy (48, `easy.jsonl`) | 47 |
| hard (111, `hard.jsonl`) | 63 |
| **Total** | **176 / 231 = 0.762** |
Brier 0.328, ECE 0.065; latency p50 27 ms, p95 60 ms per decision; mean 590 input tokens per decision.
For reference, public accuracy on the JevBench v1.4 board: Gemma 4 E2B + LoRA (system-one-open) 0.732, decider-2b
0.710, kev 0.6B 0.667, kev 4B 0.662, Qwen3.5-4B entries 0.74-0.82, Jev 1.13.0 0.866. The official JevBench score also
uses sealed items; every listed system scores well below its public accuracy there.
**Snake**: the same weights play Snake from a text board (one choice + four yes/no questions per move):
66 food per game on 12x12 on average (max 101).
## Quickstart
```bash
pip install -U huggingface_hub
hf download IFM/K2-Type-0.9B --local-dir K2-Type-0.9B && cd K2-Type-0.9B
pip install -r requirements.txt
python -m jev.serve --run . --port 8000 # from this repo's root; needs one CUDA GPU
```
The first request after start-up takes a few seconds (CUDA warm-up); later requests take about 20-60 ms.
```bash
curl -s localhost:8000/v1/systemone -H 'Content-Type: application/json' -d '{
"state": {"subject": "Charged twice", "body": "You billed my card twice for March. Refund one or I cancel."},
"questions": {
"queue": {"type": "choice", "instructions": "Which queue handles this?",
"criteria": {"billing": "Payments and refunds", "technical": "Bugs and login", "general": "Anything else"}},
"angry": {"type": "noul", "instructions": "The customer sounds angry."},
"urgency": {"type": "score", "instructions": "How urgent is it?", "criteria": ["Low", "Normal", "High", "Critical"]}
}}'
```
The request and response follow TypeSafe's `/v1/systemone` wire format, so clients written for Jev or Kev work
unchanged. `GET /health` reports the model name and temperature.
This repository contains the weights and the minimal code needed to serve them (`jev/`: input encoding, the pointer
head, and the HTTP server). Training code and data are not released at this time.
Requires transformers >= 5.17 (remote code); tested on torch 2.8. Do not use the backbone for text generation: its weights were trained
for the decision head, and the language-model head is left from the base model. Use the `jev/` server.
## How it works
- Input layout: `<state> ... | <q> question <opt> option </opt> ... <decide> | <q> ...`, using five reserved tokens of
the base tokenizer (`decision_config.json`).
- A pointer head (`pointer_head.safetensors`) scores each option's `</opt>` hidden state against the question's
`<decide>` hidden state; a softmax at temperature 1.478 gives the probabilities.
- Training, in short: full fine-tune on ~354k decision records (public classification/NLI/QA sets, Kev's decision
data, game positions with exact or search labels, and synthetic decision items written and blind-verified by a large
model), targets mixed with soft labels from a 7B teacher decision model; then 50 iterations of PPO on Snake; then a
temperature refit on held-out calibration data. Training data were checked against every Kev evaluation suite and
the 231 JevBench public items: no exact or containment overlap.
## Limits
- One pass, no reasoning: multi-step arithmetic, date differences and very long documents (> 8192 tokens) are weak.
- Calibration is fitted on Kev's calibration suite; on other distributions probabilities can be over- or
under-confident (JevBench public ECE 0.065).
- Answers are bounded by the options you give; it cannot say "none of these" unless you offer that option.
|