Views
No views yet
1# Install mlx-lm
2pip install mlx-lm
3
4# Generate directly from HF Hub
5mlx_lm.generate \
6 --model bisonnetworking/medgemma-health-chat-mlx-4bit \
7 --prompt "I've had a sore throat and low-grade fever for 3 days. What should I do?" \
8 --system-prompt "You are a board-certified Primary Care Physician. Provide direct, clinical guidance. No tables. No AI disclaimers."
9
10# Interactive chat
11mlx_lm.chat --model bisonnetworking/medgemma-health-chat-mlx-4bit1from mlx_lm import load, generate
2
3model, tokenizer = load("bisonnetworking/medgemma-health-chat-mlx-4bit")
4
5messages = [
6 {
7 "role": "system",
8 "content": "You are a board-certified Primary Care Physician. Provide direct, clinical guidance. No tables. No AI disclaimers.",
9 },
10 {
11 "role": "user",
12 "content": "I've had a sore throat and low-grade fever (100.4) for 3 days. No cough, no swollen lymph nodes. What should I do?",
13 },
14]
15
16prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
17response = generate(model, tokenizer, prompt=prompt, max_tokens=256, temp=0.7)
18print(response)1mlx_lm.server --model bisonnetworking/medgemma-health-chat-mlx-4bit --port 8080
2
3# Then use with any OpenAI client
4curl http://localhost:8080/v1/chat/completions \
5 -H "Content-Type: application/json" \
6 -d '{
7 "model": "medgemma-health-chat",
8 "messages": [
9 {"role": "system", "content": "You are a Primary Care Physician..."},
10 {"role": "user", "content": "I have a sore throat. What should I do?"}
11 ]
12 }'| Persona | Specialty |
|---|---|
| Primary Care | General practice, common conditions |
| Internal Medicine | Complex adult medicine, multi-system disorders |
| Clinical Nutritionist | Dietary interventions, nutritional therapy |
| Exercise Specialist | Therapeutic exercise, sports performance |
| Best Doctor | Cross-specialty integration, comprehensive care |
| Chronic Health | Chronic illness management, diagnostic mysteries |