Text Generation
PEFT
Safetensors
Transformers
English
Hindi
lora
sft
trl
unsloth
medical
indian-healthcare
multilingual
clinical-nlp
conversational
Instructions to use nikitaredy/medictron-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use nikitaredy/medictron-7B with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("BioMistral/BioMistral-7B") model = PeftModel.from_pretrained(base_model, "nikitaredy/medictron-7B") - Transformers
How to use nikitaredy/medictron-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nikitaredy/medictron-7B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nikitaredy/medictron-7B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nikitaredy/medictron-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nikitaredy/medictron-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nikitaredy/medictron-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nikitaredy/medictron-7B
- SGLang
How to use nikitaredy/medictron-7B 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 "nikitaredy/medictron-7B" \ --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": "nikitaredy/medictron-7B", "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 "nikitaredy/medictron-7B" \ --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": "nikitaredy/medictron-7B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use nikitaredy/medictron-7B with Docker Model Runner:
docker model run hf.co/nikitaredy/medictron-7B
| base_model: BioMistral/BioMistral-7B | |
| library_name: peft | |
| pipeline_tag: text-generation | |
| tags: | |
| - base_model:adapter:BioMistral/BioMistral-7B | |
| - lora | |
| - sft | |
| - transformers | |
| - trl | |
| - unsloth | |
| - medical | |
| - indian-healthcare | |
| - multilingual | |
| - clinical-nlp | |
| license: mit | |
| language: | |
| - en | |
| - hi | |
| # BioMistral-7B Fine-Tuned on Indian Medical Data | |
| A domain-adapted clinical LLM fine-tuned on synthetic Indian medical Q&A records using QLoRA (4-bit quantization) with Unsloth 2x speedup. Built to power the conversational AI layer of VitalKiosk β a contactless medical screening kiosk for senior and rural patients in India. | |
| ## Research Paper | |
| π [VitalKiosk: An AI-Powered Contactless Medical Screening Kiosk with rPPG-Based Vital Sign Estimation and Conversational Clinical Guidance](https://drive.google.com/file/d/10dM-Bfl9i6Z4-cjwVtUJOuzh-CpV_Xa7/view?usp=sharing) | |
| --- | |
| ## Model Details | |
| - **Developed by:** B. Nikita Reddy | |
| - **Model type:** Causal LLM β BioMistral-7B + LoRA adapter (PEFT) | |
| - **Languages:** English, Hindi | |
| - **License:** MIT | |
| - **Base model:** BioMistral/BioMistral-7B | |
| --- | |
| ## What It Does | |
| - Generates structured treatment recommendations β Allopathy, Homeopathy, Home Remedy | |
| - Supports voice input via Whisper ASR and returns spoken responses via TTS | |
| - Feeds patient vitals and symptom data into an **XGBoost-based risk analyzer** that scores patient risk from 0β100 (Low / Moderate / High / Critical) with SHAP explainability | |
| --- | |
| ## Training Details | |
| | Parameter | Value | | |
| |---|---| | |
| | Base Model | BioMistral/BioMistral-7B | | |
| | Method | QLoRA (4-bit) + Unsloth 2x speedup | | |
| | Dataset | 10,000 Indian medical Q&A records | | |
| | Hardware | Kaggle T4 GPU (15.6 GB VRAM) | | |
| | Training Time | ~9.5 hours | | |
| | Steps / Epochs | 873 steps, 5 epochs | | |
| | Parameters Trained | ~0.5% (LoRA only) | | |
| | Adapter Size | 167.8 MB LoRA safetensors | | |
| | Final Train Loss | 0.065 | | |
| | Final Val Loss | 0.163 (target < 1.0 β ) | | |
| --- | |
| ## How to Use | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| from peft import PeftModel | |
| base_model = AutoModelForCausalLM.from_pretrained("BioMistral/BioMistral-7B") | |
| model = PeftModel.from_pretrained(base_model, "YOUR_HF_USERNAME/biomistral-7b-indian-medical") | |
| tokenizer = AutoTokenizer.from_pretrained("BioMistral/BioMistral-7B") | |
| prompt = "Patient reports bukhar (fever) for 2 days. Suggest treatment." | |
| inputs = tokenizer(prompt, return_tensors="pt") | |
| outputs = model.generate(**inputs, max_new_tokens=200) | |
| print(tokenizer.decode(outputs[0], skip_special_tokens=True)) | |
| ``` | |
| --- | |
| ## Limitations | |
| - Not a replacement for licensed medical advice | |
| - Optimised for Indian medical terminology β may underperform in other clinical contexts | |
| - Hindi coverage may not extend to all regional dialects | |
| - synthetic training samples β rare conditions may be underrepresented | |
| --- | |
| ## Contact | |
| Nikita Reddy β nikitareddywork@gmail.com | |
| ### Framework Versions | |
| - PEFT 0.18.1 | |
| - Unsloth (latest at training time) | |
| - Transformers (latest at training time) |