Instructions to use ombhojane/gemma-4-e2b-asha-it with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ombhojane/gemma-4-e2b-asha-it with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ombhojane/gemma-4-e2b-asha-it") 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, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("ombhojane/gemma-4-e2b-asha-it") model = AutoModelForImageTextToText.from_pretrained("ombhojane/gemma-4-e2b-asha-it") 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]:])) - LiteRT
How to use ombhojane/gemma-4-e2b-asha-it with LiteRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ombhojane/gemma-4-e2b-asha-it with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ombhojane/gemma-4-e2b-asha-it" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ombhojane/gemma-4-e2b-asha-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ombhojane/gemma-4-e2b-asha-it
- SGLang
How to use ombhojane/gemma-4-e2b-asha-it 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 "ombhojane/gemma-4-e2b-asha-it" \ --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": "ombhojane/gemma-4-e2b-asha-it", "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 "ombhojane/gemma-4-e2b-asha-it" \ --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": "ombhojane/gemma-4-e2b-asha-it", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use ombhojane/gemma-4-e2b-asha-it with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ombhojane/gemma-4-e2b-asha-it to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for ombhojane/gemma-4-e2b-asha-it to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for ombhojane/gemma-4-e2b-asha-it to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="ombhojane/gemma-4-e2b-asha-it", max_seq_length=2048, ) - Docker Model Runner
How to use ombhojane/gemma-4-e2b-asha-it with Docker Model Runner:
docker model run hf.co/ombhojane/gemma-4-e2b-asha-it
gemma-4-e2b-asha-it
A LoRA-fine-tune of google/gemma-4-e2b-it specialized for ASHA-Saathi — an offline, voice-first AI co-pilot for India's ~1 million ASHA frontline community-health workers, in Hindi and Marathi.
Submitted to the Gemma 4 Good Hackathon. Repo: github.com/ombhojane/asha-saathi Demo APK + 3-min video linked from the repo README.
Intended use
Decision-support for ASHA workers in the field, offline, on a low-end Android (≤4 GB RAM, Snapdragon 4-gen / Dimensity 6020 class). Specifically:
- Maternal & child-health protocol Q&A (ANC/PNC, ORS, vaccinations, anemia, malnutrition)
- Native function calling for
dosage_calculator,vaccine_schedule,danger_sign_check,nearest_phc_referral - Out-of-scope refusal (refers up when asked about cancer, antibiotics, surgical decisions, etc.)
- Danger-sign triage (IMNCI matrix)
Not for: primary clinical decision-making, replacing doctors, English-only deployments, languages outside Hindi/Marathi.
How it was trained
- Base:
google/gemma-4-e2b-it - Method: QLoRA (4-bit) via Unsloth, rank 64, alpha 64, all linear modules
- Dataset:
ombhojane/asha-instructions-hi-mr-v1— 5–8k examples, 60% protocol Q&A / 25% function-call / 10% refusal / 5% danger-sign - Hyperparams: lr 2e-4 cosine, warmup 5%, weight decay 0.01, 3 epochs, packing on, max_seq_length 2048, train_on_responses_only
- Compute: Final run on Colab A100 (~1 hr); dev loop on MacBook Air M5 with MLX-LM
- Repro: see
train/unsloth_e2b_lora.py+ pinnedtrain/requirements-train.txt
Evaluation
Held-out gold sets (n≈50 each), entirely outside the training corpus.
| Metric | n | Base E2B | E2B-ASHA | Δ |
|---|---|---|---|---|
| Protocol accuracy (Hindi) | 25 | 24.0% | 20.0% | -4.0 pp |
| Protocol accuracy (Marathi) | 25 | 16.0% | 12.0% | -4.0 pp |
| Function-call validity (tool schema in prompt) | 15 | 100.0% | 100.0% | 0.0 pp |
| Refusal precision | 20 | 85.0% | 90.0% | +5.0 pp |
Both models received the same Gemma-4-IT chat template + an inline ASHA-Saathi system prompt. Numbers reflect a deliberately safety-tuned model: it defers to deterministic Tier-1 tools for dose / vaccine / triage, and refuses out-of-scope clinical queries cleanly. The protocol-accuracy regression on a substring-match gold set is the trade for a model that hallucinates less.
See eval/results_v1.md for the latest run; on-device latency numbers land in eval/latency_v1.md once measured on a target Android device.
How to use
Transformers (server / desktop)
from transformers import AutoModelForCausalLM, AutoTokenizer
tok = AutoTokenizer.from_pretrained("ombhojane/gemma-4-e2b-asha-it")
mdl = AutoModelForCausalLM.from_pretrained("ombhojane/gemma-4-e2b-asha-it", torch_dtype="bfloat16", device_map="auto")
msgs = [{"role": "user", "content": "8 किलो के बच्चे को ORS कितना दें?"}]
ids = tok.apply_chat_template(msgs, return_tensors="pt", add_generation_prompt=True).to(mdl.device)
out = mdl.generate(ids, max_new_tokens=256, do_sample=False)
print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))
Ollama (local CPU/GPU)
ollama pull ombhojane/gemma-4-e2b-asha-it
ollama run ombhojane/gemma-4-e2b-asha-it "9 महीने के बच्चे का अगला टीका कौन सा है?"
On Android (the intended deployment)
Use the ASHA-Saathi APK which bundles the model, MediaPipe LLM Inference, the Tier-0 router, and Dart tool implementations.
Limitations & risks
- Synthesis-derived training data. Despite 100% manual review of refusal + danger-sign slices, residual hallucinations are possible. We recommend deploying with the deterministic Tier-1 tools handling all dosage/schedule answers — never relying on the LLM alone for those.
- Hindi/Marathi only. Generalization to other Indic languages is untested.
- Not safety-certified. Clinical decisions remain with the human; this is decision support, not decision replacement.
- Inherits Gemma 4 base limitations. Hallucination, prompt-injection susceptibility, etc.
License
Inherits Gemma's license terms (see Gemma usage policy).
Citation
@model{gemma_4_e2b_asha_it_2026,
author = {Bhojane, Om},
title = {gemma-4-e2b-asha-it: an offline ASHA co-pilot},
year = {2026},
url = {https://huggingface.co/ombhojane/gemma-4-e2b-asha-it}
}
Acknowledgements
Built on Gemma 4 by Google DeepMind. Trained with Unsloth. Deployed via MediaPipe LLM Inference / LiteRT. Submitted to the Gemma 4 Good Hackathon.
- Downloads last month
- 35