epfl-llm/guidelines
Viewer • Updated • 38k • 1.29k • 151
How to use bisonnetworking/MediPhi-Instruct-mlx-4bit with MLX:
# Make sure mlx-lm is installed
# pip install --upgrade mlx-lm
# Generate text with mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("bisonnetworking/MediPhi-Instruct-mlx-4bit")
prompt = "Write a story about Einstein"
messages = [{"role": "user", "content": prompt}]
prompt = tokenizer.apply_chat_template(
messages, add_generation_prompt=True
)
text = generate(model, tokenizer, prompt=prompt, verbose=True)How to use bisonnetworking/MediPhi-Instruct-mlx-4bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "bisonnetworking/MediPhi-Instruct-mlx-4bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "bisonnetworking/MediPhi-Instruct-mlx-4bit"
# Calling the OpenAI-compatible server with curl
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "bisonnetworking/MediPhi-Instruct-mlx-4bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'This repository contains an MLX-format 4-bit quantized version ofmicrosoft/MediPhi-Instruct,
converted using mlx-lm for efficient on-device inference on Apple silicon.
This model is intended for iOS / iPadOS / macOS usage where memory and power constraints require aggressive quantization while preserving clinical reasoning quality.
⚠️ This is a conversion only. No additional fine-tuning was performed.
Compared to larger 4–7B medical models, MediPhi-Instruct shows:
This makes it a strong candidate for on-device medical assistants on iPhone and iPad.
pip install mlx-lm
4-bit
Base model
microsoft/Phi-3.5-mini-instruct