Instructions to use kushalpatil/jevify-gemma4-e4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kushalpatil/jevify-gemma4-e4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kushalpatil/jevify-gemma4-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("kushalpatil/jevify-gemma4-e4b") model = AutoModelForMultimodalLM.from_pretrained("kushalpatil/jevify-gemma4-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 kushalpatil/jevify-gemma4-e4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kushalpatil/jevify-gemma4-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": "kushalpatil/jevify-gemma4-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/kushalpatil/jevify-gemma4-e4b
- SGLang
How to use kushalpatil/jevify-gemma4-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 "kushalpatil/jevify-gemma4-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": "kushalpatil/jevify-gemma4-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 "kushalpatil/jevify-gemma4-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": "kushalpatil/jevify-gemma4-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 kushalpatil/jevify-gemma4-e4b with Docker Model Runner:
docker model run hf.co/kushalpatil/jevify-gemma4-e4b
kushalpatil/jevify-gemma4-e4b
google/gemma-4-E4B-it fine-tuned (LoRA, merged) to give honest probabilities when asked typed questions
about a piece of state — the model behind jevify, a local,
Jev-compatible probabilistic decision API.
Nothing is generated: one prefill, read the next-token distribution over the answer labels, done.
Use
pip install "jevify[transformers] @ git+https://github.com/kushalpatil07/jevify"
jevify serve --model kushalpatil/jevify-gemma4-e4b # POST /v1/systemone, Jev wire format
from jevify import Jevify, Noul, Choice, Score
jev = Jevify.from_transformers("kushalpatil/jevify-gemma4-e4b") # or serve it with vLLM and use Jevify.from_runtime("vllm", "kushalpatil/jevify-gemma4-e4b")
jev.system_one("Help! My payouts have been failing for 3 days.", {
"urgent": Noul("Does this convey urgency?"),
"team": Choice("Which team should handle this?", {"billing": None, "technical": None, "sales": None}),
"mood": Score("How frustrated is the customer?", ["calm", "frustrated", "furious"]),
})
Training
LoRA r=64 on attention projections, 2 epochs over ~47k (state, question, target-distribution)
items from 16 sources: hard-labeled classification sets with randomized option subsets and
order, multi-annotator sets with real human label distributions, and constructed long states
(up to 24k tokens) with answers known by construction. Loss = KL(target || label distribution).
No teacher model. Recipe: train/ in the jevify repo.
Results
Held-out, out-of-distribution (6 datasets not used in training; 307 items), no post-hoc scaling:
ood_massive n= 50 acc=0.900 nll=0.308 brier=0.140 ece=0.065 conf=0.932
ood_trec n= 50 acc=0.940 nll=0.201 brier=0.095 ece=0.097 conf=0.874
ood_paws n= 50 acc=0.540 nll=0.915 brier=0.622 ece=0.262 conf=0.792
ood_sms_spam n= 50 acc=0.980 nll=0.121 brier=0.056 ece=0.046 conf=0.934
ood_app_reviews n= 50 acc=0.740 nll=0.901 brier=0.427 ece=0.126 conf=0.705
ood_subj n= 50 acc=0.940 nll=0.218 brier=0.109 ece=0.128 conf=0.841
spike n= 7 acc=1.000 nll=0.051 brier=0.021 ece=0.044 conf=0.956
ALL n= 307 acc=0.844 nll=0.435 brier=0.237 ece=0.043 conf=0.849
In-distribution held-out (800 items), raw -> trained:
step 0 acc=0.745 conf=0.962 ece=0.217 nll=1.827 brier=0.412
step 1209 acc=0.823 conf=0.823 ece=0.028 nll=0.438 brier=0.193
- Downloads last month
- -