Instructions to use GizzAI/Gizzai-Sense-E4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GizzAI/Gizzai-Sense-E4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="GizzAI/Gizzai-Sense-E4B") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("GizzAI/Gizzai-Sense-E4B") model = AutoModelForMultimodalLM.from_pretrained("GizzAI/Gizzai-Sense-E4B", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use GizzAI/Gizzai-Sense-E4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GizzAI/Gizzai-Sense-E4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GizzAI/Gizzai-Sense-E4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/GizzAI/Gizzai-Sense-E4B
- SGLang
How to use GizzAI/Gizzai-Sense-E4B 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 "GizzAI/Gizzai-Sense-E4B" \ --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": "GizzAI/Gizzai-Sense-E4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "GizzAI/Gizzai-Sense-E4B" \ --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": "GizzAI/Gizzai-Sense-E4B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use GizzAI/Gizzai-Sense-E4B with Docker Model Runner:
docker model run hf.co/GizzAI/Gizzai-Sense-E4B
Gizzai-Sense-E4B · 叽喳 Sense E4B
Typed decisions with calibrated probabilities. Ask a yes/no, pick-one or ordered-score question about text, an image or a short audio clip; get back a probability for every option you listed -- nothing else. The model never generates text for a decision: it reads the next-token distribution restricted to one token per option, so the answer is always one of your options and the output is zero tokens.
Built on Google's Gemma 4 (google/gemma-4-E4B-it); weights are merged, so it loads with plain
transformers, no adapter library.
Technical report, in English and Chinese with the demo videos: GizzAI/Gizzai-Sense-Report
Inference code on GitHub: wzsxb233/gizzai-sense
Live bilingual demo / 在线双语试用:Hugging Face Space · ModelScope Studio
Quick start
pip install modelscope torch "transformers>=5.17" pillow librosa
modelscope download --model GizzAI/Gizzai-Sense-E4B --local_dir Gizzai-Sense-E4B
import sys
sys.path.insert(0, "Gizzai-Sense-E4B") # sense.py ships with the weights
from sense import Sense
s = Sense("Gizzai-Sense-E4B")
ticket = "Checkout returns 502 for every EU customer since 09:00."
review = "Arrived two weeks late and the box was crushed."
print(s.noul("部署连续失败两次,客户已经看到 500 错误。", "需要立即处理吗?")) # P(yes)
print(s.choice(ticket, "Which team owns this?", {"infra": "Infrastructure", "billing": "Billing"},
open_set=True)) # adds "none of these"
print(s.score(review, "How satisfied is the customer?", ["angry", "unhappy", "neutral", "happy"]))
print(s.noul("", "Is there a dog in the photo?", # your own image
media=[{"type": "image", "image": "photo.jpg"}]))
sense.py and sense_format.py ship with the weights. They are the reference
implementation: one forward pass per question, audio up to 30 s per clip.
Tested with torch 2.14 and transformers 5.17; pillow is needed for images and
librosa (or torchcodec) for audio files.
Each answer also carries confidence: 1 minus the normalised entropy (|2p - 1| for yes/no),
so 0 means the options are equally likely and 1 means one is certain. To send uncertain
answers to a person with a threshold, compare the threshold with the top probability in
probabilities, not with confidence.
Demos
Screen recordings of live runs; nothing is replayed from stored outputs. The game and driving adapters are not part of this release: they show how quickly expert judgement distils into these weights. A ground-truth safety driver was armed in both driving runs and never had to brake.
Homework marking, fast and slow
Gizzai-Sense-E2B marks each homework item with one forward pass; items it is less than 80% sure of go to Gizzai-Sense-E4B, which writes a short verdict. In this run the fast system settled 9 of 10 items on its own.
Blackjack
The released E2B next to the same model plus a small adapter distilled from the basic-strategy table (1,500 expert-labelled positions, one epoch, about 20 minutes on one RTX 3090). The video shows the first 12 held-out positions; on all 150, accuracy goes from 0.527 to 0.953.
Chess: mate in one
The same recipe with a mate-in-one checker as the expert: accuracy 0.500 to 0.727 on 150 held-out positions.
Driving in MuJoCo, before
Every camera frame gets two yes/no questions: is the light ahead red, and is there a pedestrian or obstacle on the road. The released E2B stops at the red light, then keeps reading the green light as red (P = 0.55) and waits.
Driving in MuJoCo, after
The same model plus an adapter distilled from simulator ground truth: it stops at red, goes on green and stops for the pedestrian. On 300 held-out frames, red light 0.67 to 0.99 and obstacle 0.69 to 0.96.
Evaluation
Every number below comes from the released weights themselves. Both rows use the same prompts and readout. Temperatures are fitted per question type on an in-distribution dev set and then applied unchanged.
Sealed set, never used for any decision
QNLI, Yahoo Answers topics, Amazon reviews; opened once for this release; 900 questions.
| accuracy | calibration error (ECE, lower is better) | |
|---|---|---|
| Gemma 4 (untrained, same readout) | 0.740 | 0.087 |
| Gizzai Sense | 0.732 | 0.080 |
| question type | base acc / ECE | Sense acc / ECE |
|---|---|---|
| yes / no | 0.880 / 0.072 | 0.870 / 0.054 |
| pick one | 0.740 / 0.127 | 0.753 / 0.134 |
| ordered score | 0.600 / 0.061 | 0.573 / 0.054 |
Datasets never used in training
RTE (entailment), DBpedia-14 (topic), Yelp (5-star rating); 900 questions.
| accuracy | calibration error (ECE, lower is better) | |
|---|---|---|
| Gemma 4 (untrained, same readout) | 0.821 | 0.076 |
| Gizzai Sense | 0.809 | 0.052 |
| question type | base acc / ECE | Sense acc / ECE |
|---|---|---|
| yes / no | 0.887 / 0.090 | 0.840 / 0.042 |
| pick one | 0.963 / 0.053 | 0.973 / 0.010 |
| ordered score | 0.613 / 0.083 | 0.613 / 0.103 |
Tasks never used in training
SciTail, QASC, IBM argument quality; 900 questions.
| accuracy | calibration error (ECE, lower is better) | |
|---|---|---|
| Gemma 4 (untrained, same readout) | 0.496 | 0.146 |
| Gizzai Sense | 0.522 | 0.127 |
| question type | base acc / ECE | Sense acc / ECE |
|---|---|---|
| yes / no | 0.793 / 0.071 | 0.763 / 0.063 |
| pick one | 0.483 / 0.180 | 0.530 / 0.182 |
| ordered score | 0.210 / 0.186 | 0.273 / 0.135 |
Vision, audio, cross-modal
Oxford-IIIT Pet, Speech Commands, image+speech matching; 720 questions.
| accuracy | calibration error (ECE, lower is better) | |
|---|---|---|
| Gemma 4 (untrained, same readout) | 0.826 | 0.064 |
| Gizzai Sense | 0.932 | 0.034 |
| question type | base acc / ECE | Sense acc / ECE |
|---|---|---|
| yes / no | 0.853 / 0.085 | 0.939 / 0.024 |
| pick one | 0.800 / 0.042 | 0.925 / 0.044 |
Reference set
BoolQ, AG News, SST-5 (AG News and SST-5 are not in the training data); 900 questions.
| accuracy | calibration error (ECE, lower is better) | |
|---|---|---|
| Gemma 4 (untrained, same readout) | 0.710 | 0.096 |
| Gizzai Sense | 0.739 | 0.085 |
| question type | base acc / ECE | Sense acc / ECE |
|---|---|---|
| yes / no | 0.857 / 0.079 | 0.890 / 0.038 |
| pick one | 0.817 / 0.129 | 0.860 / 0.097 |
| ordered score | 0.457 / 0.080 | 0.467 / 0.119 |
What the merge preserved
The adapter was merged with compensated rounding onto bf16. Against the unmerged adapter on 600 held-out questions, the largest change in any probability is 0.0342, the mean change is 0.0036, and 3 answers flip. On the dev-set texts, next-token loss is 3.242 nats for the untrained model and 2.919 for Gizzai Sense, so the adaptation did not degrade the language model on this text.
Latency: p50 108 ms per question on one RTX 3090 (bf16, reference implementation).
Limitations
- Calibration was measured on the datasets above. Check it on your own data before
relying on the probabilities; the temperatures in
sense_readout.jsoncan be refitted. - Ordered scores are the hardest of the three question types.
- Audio is read 30 s at a time; longer clips need splitting.
- Trained on English and Chinese data.
- An open-set question only detects "none of these"; it does not propose new options.
Intended use
Routing, triage, moderation, grading and other decisions that should come with a probability. Not for fully automated decisions with legal or similarly significant effects on people: keep a human in the loop and send low-confidence answers to a person (see USE_POLICY.md and the Gemma Prohibited Use Policy).
License
Weights and reference inference code: Gizzai Sense License (see LICENSE), which is the Apache License 2.0 plus additional terms. Free for individuals, academic research and organisations with annual revenue up to US$100,000; a commercial licence is required above that. Gemma 4 is Apache-2.0 by Google.
Optimised serving (batching, long audio and video, multi-step decision graphs), the training framework, the RL framework, and commercial or academic collaboration: dengyicun@gizzai.com
Training data
20 English and Chinese text decision tasks plus image and audio tasks, all commercially licensed; see NOTICE. Rows overlapping any evaluation set were removed before training.
中文简介
叽喳 Sense:输出带校准概率的类型化判断(是/否、单选、评分),支持文本、图像和 30 秒以内的音频。 模型不生成任何文字,只在你给出的选项上输出概率。权重已合并,可直接用 transformers 加载。 演示录屏(阅卷快慢系统、21 点、国际象棋、MuJoCo 驾驶)见上方 Demos 一节;中英双语技术报告: https://modelscope.cn/studios/GizzAI/Gizzai-Sense-Report 许可协议为 Apache 2.0 加附加条款(见 LICENSE):个人、学术研究与年营收 10 万美元以下的组织可免费使用;商业授权、学术合作,以及高性能推理、训练与强化学习框架,请联系 dengyicun@gizzai.com。
- Downloads last month
- 6