Run this model with HF Jobs
Run Xylolabs/phi-4-MLX-4bit 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-4bit. 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-4bit 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-4bit. 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-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Xylolabs/phi-4-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("Xylolabs/phi-4-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 Xylolabs/phi-4-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 "Xylolabs/phi-4-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Xylolabs/phi-4-MLX-4bit" # 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-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
File size: 1,221 Bytes
56d24b1 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | c49419617a6070bcb197cfe272f7007fdec3e790dbb529cb995473bd69c0bd51 LICENSE
2a02e6cc2ced0ccc1e9214652b73fb596046b101c549f8bbf821383daa995ac2 README.md
9681e9e511e2b3e3a2f76d700b6adeec0b675a25a3fc7663b0832713d3ca9e59 accuracy-by-size.csv
e14652068b8324a6d7ffbbb7269689eaa250b771274760fd9b663403e8feedf9 accuracy-mean-kl-dark.png
1179b5102730e2b9e3b06b0e5ab09a5322c26167f4fe4aa303972979f7c4c587 accuracy-top1-dark.png
fe4120415a3858b873955c92ce3a103a95bc97c2cb00b72e62659aaf0f891ee5 chat_template.jinja
7b2c82b9a430282d4af0cd2c33b6f838aa6830cae0c3a8c7f2f640be3eec5075 config.json
6acf48d95f0a1deb97acf54d946636243e299bf315b068efd719708ceea5741d generation_config.json
6d5b42cee4bb72c1f05e50d811eb910d3d460b13b29e3d8cdacaff00f850af87 model-00001-of-00002.safetensors
b84b186a715b0ac52c218122e59ff5a021efa6ba27bb75f47a57fe6a5cb680bb model-00002-of-00002.safetensors
d212c8fb57d1a3b9a2e8bcd43d3b5ad9c707fa80b38df3e4ef9307c52a1a6d6e model.safetensors.index.json
e1ad87e1f5086dc8940b70588793a01b82009f20ab4532bb0c5c2910558f05dc sota_obs_summary.json
589dc0f70c1b6b229e5047f26e9ed3aa175800d3508b3a1709957cf0f60602b1 tokenizer.json
35730798785f378cd7f874000caec949723bbcc2b5b1f4ddabbbe6d5b5e9b9a7 tokenizer_config.json
|