Text Generation
MLX
Safetensors
English
phi3
mlx-lm
phi
phi-3
medical
clinical
healthcare
quantized
4bit
on-device
ios
apple-silicon
conversational
4-bit precision
Instructions to use bisonnetworking/MediPhi-Instruct-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
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) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use bisonnetworking/MediPhi-Instruct-mlx-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "bisonnetworking/MediPhi-Instruct-mlx-4bit"
Run an OpenAI-compatible server
# 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"} ] }' - Atomic Chat
Commit History
-
Fix tokenizer configuration for proper MLX compatibility
- Add all special tokens to additional_special_tokens and added_tokens_decoder - Add special tokens: <|system|>, <|user|>, <|assistant|>, <|end|> - Embed chat_template directly in tokenizer_config.json - Fix tokenizer_class from LlamaTokenizer to PreTrainedTokenizerFast - Add proper token ID mappings for Phi-3 format - Ensure compatibility with and without system prompts This update ensures proper tokenization for MLX inference with the Phi-3 chat format, supporting flexible usage with or without system prompts in multi-turn conversations. Tested with mlx-lm and verified correct token encoding. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>eaba2fa
-
Upload folder using huggingface_hub
Verified signature6b84460 -
initial commit
Verified signaturea7da84b