Text Generation
MLX
Safetensors
PyTorch
English
llama4_text
facebook
meta
mobilellm
mlx - apple-mlx - runtime
conversational
Instructions to use robbiemu/MobileLLM-R1-950M-MLX with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use robbiemu/MobileLLM-R1-950M-MLX 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("robbiemu/MobileLLM-R1-950M-MLX") 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
- Pi
How to use robbiemu/MobileLLM-R1-950M-MLX with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robbiemu/MobileLLM-R1-950M-MLX"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "robbiemu/MobileLLM-R1-950M-MLX" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use robbiemu/MobileLLM-R1-950M-MLX with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "robbiemu/MobileLLM-R1-950M-MLX"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "robbiemu/MobileLLM-R1-950M-MLX" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "robbiemu/MobileLLM-R1-950M-MLX", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use robbiemu/MobileLLM-R1-950M-MLX with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robbiemu/MobileLLM-R1-950M-MLX"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default robbiemu/MobileLLM-R1-950M-MLX
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use robbiemu/MobileLLM-R1-950M-MLX with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "robbiemu/MobileLLM-R1-950M-MLX"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "robbiemu/MobileLLM-R1-950M-MLX" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download custom_mlx_lm/quant_summary.py from robbiemu/MobileLLM-R1-950M-MLX: direct link, hf CLI and curl.
- Browser
- Download file 2.02 kB
-
https://huggingface.co/robbiemu/MobileLLM-R1-950M-MLX/resolve/main/custom_mlx_lm/quant_summary.py
- Command line
-
hf download hf://robbiemu/MobileLLM-R1-950M-MLX/custom_mlx_lm/quant_summary.py
-
curl -L -o quant_summary.py https://huggingface.co/robbiemu/MobileLLM-R1-950M-MLX/resolve/main/custom_mlx_lm/quant_summary.py
2.02 kB
| import argparse | |
| import json | |
| from pathlib import Path | |
| import numpy as np | |
| def main(): | |
| p = argparse.ArgumentParser(description="Summarize MLX-LM quantization layout") | |
| p.add_argument("--model-path", required=True, help="Path to converted MLX model") | |
| p.add_argument("--show", type=int, default=10, help="Show up to N entries per group") | |
| args = p.parse_args() | |
| mpath = Path(args.model_path) | |
| cfg = json.loads((mpath / "config.json").read_text()) | |
| q = cfg.get("quantization") or {} | |
| method = q.get("method", "none") | |
| gsize = q.get("group_size") | |
| plb = q.get("per_layer_bits", {}) | |
| print(f"Method: {method}") | |
| print(f"Group size: {gsize}") | |
| if method == "uniform": | |
| print(f"Uniform bits: {q.get('bits')}") | |
| return | |
| if not plb: | |
| print("No per-layer bits found in config.") | |
| return | |
| # Basic counts | |
| buckets = {4: [], 8: [], "other": []} | |
| for k, b in plb.items(): | |
| if b == 4: | |
| buckets[4].append(k) | |
| elif b == 8: | |
| buckets[8].append(k) | |
| else: | |
| buckets["other"].append(k) | |
| total = sum(len(v) for v in buckets.values()) | |
| print(f"Total linear layers: {total}") | |
| print(f"4-bit layers: {len(buckets[4])}") | |
| print(f"8-bit layers: {len(buckets[8])}") | |
| if buckets["other"]: | |
| print(f"Other-bit layers: {len(buckets['other'])}") | |
| # Optional: show a few examples | |
| for b in (8, 4): | |
| items = sorted(buckets[b]) | |
| if not items: | |
| continue | |
| print(f"\nExamples ({b}-bit):") | |
| for k in items[: args.show]: | |
| print(f"- {k}") | |
| # Optional: sanity-check against npz contents | |
| try: | |
| npz = np.load(mpath / "weights.npz", allow_pickle=False) | |
| has_q = any(k.endswith(".scales") or k.endswith(".biases") for k in npz.files) | |
| print(f"\nweights.npz contains quantized tensors: {has_q}") | |
| except Exception as e: | |
| print(f"Note: could not open weights.npz: {e}") | |
| if __name__ == "__main__": | |
| main() | |