Run this model with HF Jobs
Run Xylolabs/phi-4-MLX-8bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/Xylolabs/phi-4-MLX-8bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Xylolabs/phi-4-MLX-8bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Xylolabs/phi-4-MLX-8bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use Xylolabs/phi-4-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/phi-4-MLX-8bit 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("Xylolabs/phi-4-MLX-8bit") 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 Xylolabs/phi-4-MLX-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "Xylolabs/phi-4-MLX-8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Xylolabs/phi-4-MLX-8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xylolabs/phi-4-MLX-8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
File size: 1,232 Bytes
efac72f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | c49419617a6070bcb197cfe272f7007fdec3e790dbb529cb995473bd69c0bd51 LICENSE
f0d86fc1dfb8989ac8cf458cfe95bd7495da7f38aa128b209f34a21b8f0a4976 README.md
9681e9e511e2b3e3a2f76d700b6adeec0b675a25a3fc7663b0832713d3ca9e59 accuracy-by-size.csv
e14652068b8324a6d7ffbbb7269689eaa250b771274760fd9b663403e8feedf9 accuracy-mean-kl-dark.png
1179b5102730e2b9e3b06b0e5ab09a5322c26167f4fe4aa303972979f7c4c587 accuracy-top1-dark.png
fe4120415a3858b873955c92ce3a103a95bc97c2cb00b72e62659aaf0f891ee5 chat_template.jinja
8299274ef74d47f11f0ba1f8c3d4b1c2b13a332302fd2fd9b66c599397d44dbf config.json
6acf48d95f0a1deb97acf54d946636243e299bf315b068efd719708ceea5741d generation_config.json
afcb1bd4b84c756aacc8fb3bd24586d8650db95a1b2ef70087dd0f86a49a9f35 model-00001-of-00003.safetensors
ff64c204e7c445fe22c3d7ed7b86c4da1c0304e39342008c777ae9877996cd51 model-00002-of-00003.safetensors
292cb66d0f0aa6462b49316d4f688d12d15631ec7c923430a780f9965141070d model-00003-of-00003.safetensors
0dbf10e46590c4d8dc4b5565a34ec81e1ae17d2ecb4338f7094e365d8c1baf8f model.safetensors.index.json
589dc0f70c1b6b229e5047f26e9ed3aa175800d3508b3a1709957cf0f60602b1 tokenizer.json
35730798785f378cd7f874000caec949723bbcc2b5b1f4ddabbbe6d5b5e9b9a7 tokenizer_config.json
|