Views
No views yet
| Persona | Specialty |
|---|---|
| Primary Care | General practice, common conditions, preventive care |
| Internal Medicine | Complex adult medicine, multi-system disorders, chronic disease |
| Clinical Nutritionist | Dietary interventions, nutritional therapy, meal planning |
| Exercise Specialist | Therapeutic exercise, sports performance, rehabilitation |
| Best Doctor | Cross-specialty integration, OLDCARTS methodology, comprehensive care |
| Chronic Health | Chronic illness management, diagnostic mysteries, patient coaching |
merge_and_unload(). The merged model is distributed as two safetensors shards (~8.6GB total).1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model_id = "bisonnetworking/medgemma-health-chat-merged"
5
6model = AutoModelForCausalLM.from_pretrained(
7 model_id,
8 torch_dtype=torch.float16,
9 device_map="auto",
10 trust_remote_code=True,
11)
12tokenizer = AutoTokenizer.from_pretrained(model_id)
13
14messages = [
15 {
16 "role": "system",
17 "content": "You are a board-certified Primary Care Physician. Provide clinical guidance with professionalism and clarity. Use ONLY health data explicitly provided in user context. No tables. No AI disclaimers. Answer the specific question asked - no more, no less.",
18 },
19 {
20 "role": "user",
21 "content": "PATIENT CONTEXT: Age 52, Male. BP: 145/92 mmHg. Medications: Lisinopril 20mg daily. Conditions: Hypertension.\n\nMy blood pressure has been reading higher than usual the past week. Should I adjust my medication?",
22 },
23]
24
25inputs = tokenizer.apply_chat_template(
26 messages, return_tensors="pt", add_generation_prompt=True
27).to(model.device)
28
29outputs = model.generate(
30 inputs,
31 max_new_tokens=512,
32 temperature=0.7,
33 top_p=0.9,
34 do_sample=True,
35)
36response = tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)
37print(response)1from vllm import LLM, SamplingParams
2
3llm = LLM(model="bisonnetworking/medgemma-health-chat-merged", dtype="float16")
4sampling = SamplingParams(temperature=0.7, top_p=0.9, max_tokens=512)
5
6messages = [
7 {"role": "system", "content": "You are a board-certified Primary Care Physician..."},
8 {"role": "user", "content": "I've had a sore throat for 3 days. What should I do?"},
9]
10prompt = llm.get_tokenizer().apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
11outputs = llm.generate([prompt], sampling)
12print(outputs[0].outputs[0].text)1# Convert to MLX format
2pip install mlx-lm
3mlx_lm.convert --hf-path bisonnetworking/medgemma-health-chat-merged --mlx-path ./medgemma-health-chat-mlx
4mlx_lm.generate --model ./medgemma-health-chat-mlx --prompt "I've had a sore throat for 3 days. What should I do?"| Category | Cases/Persona | What It Tests |
|---|---|---|
| Medical accuracy | 14 | Clinically correct information for persona's specialty |
| Persona adherence | 9 | Response style matches persona (direct, no AI disclaimers, concise) |
| Health context usage | 10 | References actual values from provided health data |
| Data integrity | 6 | Does not hallucinate data not in context |
| Safety | 6 | Recognizes emergencies, recommends 911/988/Poison Control |
| Formatting | 5 | No markdown tables, no AI disclaimers, mobile-friendly |
test_data/.