Instructions to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-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("Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-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
- Pi
How to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit"
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": "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-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 "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-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": "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit 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 "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit"
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 Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit"
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 "Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit" \ --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"
Ornith-1.5-9B-CodeAlpaca — MLX 4-bit
Author / fine-tuning / quantization: Irfan Uruchi
Upstream model: ornith-ai/Ornith-1.5-9B
Variant: Primary MLX export
Checkpoint
I fine-tuned Ornith-1.5-9B with distributed MLX QLoRA on 3,600 CodeAlpaca instruction–response pairs. Training used an Apple M6 Mac mini and an Apple M3 Pro MacBook Pro linked by Thunderbolt Bridge. This repository contains the merged model quantized to 4-bit affine with group size 64. Each MLX precision was quantized independently from the same higher-precision merged checkpoint, not from another low-bit export.
Measured behavior
| Custom coding benchmark | Result |
|---|---|
| Tasks with every assertion passing | 29/30 |
| Assertions passing | 120/121 |
| Functions with all parameter and return annotations | 14/30 |
| Generation time for 30 prompts | 116.3 s |
matrix_diagonal_sum failed its empty-matrix assertion.
These are results from one deterministic generation per prompt, with a maximum of 512 generated tokens; they are not HumanEval or MBPP scores. The 121 assertions run in restricted Docker containers. The evaluation record describes the extractor and scoring corrections. The time total is not a standardized throughput benchmark.
Inference
Tested with mlx==0.32.4 and mlx-lm==0.32.2:
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler
model, tokenizer = load("Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit")
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "Write an iterative Python fibonacci function."}],
tokenize=False,
add_generation_prompt=True,
enable_thinking=False,
)
print(generate(
model, tokenizer, prompt=prompt, max_tokens=512,
sampler=make_sampler(temp=0), verbose=False,
))
Sources and credit
- Fine-tuning, distributed setup, quantization and evaluation: Irfan Uruchi.
- Upstream weights: Ornith AI, Ornith-1.5-9B (upstream repository declares MIT).
- Training data: CodeAlpaca-20k by Sahil Chaudhary; original project. Local source identity and split hashes are in the training report.
Release terms
I release my fine-tuning and conversion contributions for noncommercial research and evaluation under CC BY-NC 4.0, to the extent I hold those rights. This does not replace Ornith's upstream MIT terms, change the original CodeAlpaca dataset terms, or grant rights held by third parties. No raw CodeAlpaca dataset files are distributed here.
- Downloads last month
- 29
4-bit
Model tree for Irfanuruchi/Ornith-1.5-9B-CodeAlpaca-MLX-4bit
Base model
ornith-ai/Ornith-1.5-9B