Instructions to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Roopalgn/sahayak-tb-gemma4-e2b-gguf", filename="gemma-4-e2b-it.F16-mmproj.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - llama-cpp-python
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Roopalgn/sahayak-tb-gemma4-e2b-gguf", filename="gemma-4-e2b-it.F16-mmproj.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16 # Run inference directly in the terminal: llama-cli -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16 # Run inference directly in the terminal: llama-cli -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
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 Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16 # Run inference directly in the terminal: ./llama-cli -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
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 Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
Use Docker
docker model run hf.co/Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
- LM Studio
- Jan
- vLLM
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Roopalgn/sahayak-tb-gemma4-e2b-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Roopalgn/sahayak-tb-gemma4-e2b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
- Ollama
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with Ollama:
ollama run hf.co/Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
- Unsloth Studio new
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf 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 Roopalgn/sahayak-tb-gemma4-e2b-gguf 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 Roopalgn/sahayak-tb-gemma4-e2b-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Roopalgn/sahayak-tb-gemma4-e2b-gguf to start chatting
- Docker Model Runner
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with Docker Model Runner:
docker model run hf.co/Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
- Lemonade
How to use Roopalgn/sahayak-tb-gemma4-e2b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Roopalgn/sahayak-tb-gemma4-e2b-gguf:F16
Run and chat with the model
lemonade run user.sahayak-tb-gemma4-e2b-gguf-F16
List all available models
lemonade list
SAHAYAK-TB โ Fine-tuned Gemma 4 E2B for TB Dropout Risk Assessment
What This Model Does
Takes natural-language multi-visit notes from a DOTS (Directly Observed Treatment) provider and outputs a structured JSON risk assessment for TB treatment adherence dropout.
Input: 2-4 visit notes in English, Hindi, or mixed (as DOTS providers actually write)
Output: JSON with dropout risk tier (low/moderate/high/critical), evidence-cited risk factors with published odds ratios and PMIDs, and NTEP protocol action recommendations.
Key Specs
| Base model | Gemma 4 E2B-it |
| Fine-tuning | QLoRA (r=16, alpha=16, all-linear) via Unsloth |
| Training data | 500 synthetic cases from 15 published TB adherence risk factors |
| Quantization | Q4_K_M (3.43 GB) for CPU inference |
| Accuracy | 90% tier accuracy with post-processing pipeline |
| Schema compliance | 100% (constrained JSON output) |
| Inference | CPU-only via llama-cpp-python, 24-88 seconds |
Usage with llama-cpp-python
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="Roopalgn/sahayak-tb-gemma4-e2b-gguf",
filename="gemma-4-e2b-it.Q4_K_M.gguf",
n_ctx=4096,
n_gpu_layers=0,
)
response = llm.create_chat_completion(
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": visit_notes},
],
response_format={"type": "json_object", "schema": RISK_SCHEMA},
temperature=0.0,
)
See full system prompt and schema at: github.com/Roopalgn/gemma4good
Live Demo
huggingface.co/spaces/Roopalgn/sahayak-tb-demo
Training Details
- Platform: Kaggle T4 GPU (free tier, $0 cost)
- Training time: 33 minutes
- Loss: 3.04 to 0.0115
- Method: SFT with train_on_responses_only
Data Sources
15 risk factors with published odds ratios from Indian TB cohort studies:
- Santha et al. 2002 (PMID 12234133)
- Vijay et al. 2010 (PMID 20386611)
- Kumar et al. 2024 (PMID 39067959)
- WHO Treatment of TB Guidelines (4th ed.)
No patient-identifiable data used. Fully synthetic training data.
License
CC-BY 4.0
Built for
Gemma 4 Good Hackathon โ Health & Sciences track + llama.cpp Prize
- Downloads last month
- 943
4-bit
16-bit