Instructions to use vochris/rare-bird-gemma4-e2b-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use vochris/rare-bird-gemma4-e2b-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("vochris/rare-bird-gemma4-e2b-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 vochris/rare-bird-gemma4-e2b-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 "vochris/rare-bird-gemma4-e2b-mlx-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "vochris/rare-bird-gemma4-e2b-mlx-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use vochris/rare-bird-gemma4-e2b-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 "vochris/rare-bird-gemma4-e2b-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 vochris/rare-bird-gemma4-e2b-mlx-4bit
Run Hermes
hermes
- OpenClaw new
How to use vochris/rare-bird-gemma4-e2b-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 "vochris/rare-bird-gemma4-e2b-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 "vochris/rare-bird-gemma4-e2b-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"
- MLX LM
How to use vochris/rare-bird-gemma4-e2b-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 "vochris/rare-bird-gemma4-e2b-mlx-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "vochris/rare-bird-gemma4-e2b-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": "vochris/rare-bird-gemma4-e2b-mlx-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Rare Bird Gemma 4 E2B MLX 4-bit
Rare Bird is a local aircraft-rarity classifier for an iPhone app. Given a normalized aircraft sighting and regional observer context, it predicts whether the aircraft is uncommon, noteworthy, or chase-worthy enough to surface to an aviation-curious user.
This repository contains the app-sized MLX 4-bit conversion of the fine-tuned Rare Bird model.
Model Details
- Base model:
google/gemma-4-E2B-it - Fine-tuning method: LoRA/QLoRA adapter
- Deployment export: LoRA merged into the base model, then converted to MLX
- Quantization: MLX 4-bit, 4.501 bits per weight
- Artifact size: about 2.5 GB
- Target use: local iPhone app prototype and Apple Silicon development
Task
The model classifies Southern California aircraft sightings. It is trained to consider:
- aircraft type and description
- callsign, registration, and operator
- altitude, speed, heading, and distance
- Orange County and Los Angeles regional context
- whether military traffic is near a routine base/test pattern
- rare type, rare callsign, special registration, and emergency-squawk signals
Expected output is one JSON object:
{
"is_rare": true,
"confidence": 0.9,
"reason": "Boeing 747-400 Dreamlifter is rare for Orange County or Los Angeles County because it represents very limited modified freighter examples."
}
Prompt Format
Use the full Rare Bird training-style prompt. Short prompts without the reference policy are not reliable.
### System
You are Rare Bird, a strict aircraft rarity classifier for plane spotters. You must output exactly one JSON object with keys is_rare, confidence, reason. No markdown, no metadata, no extra keys.
### Input JSON
{...full Rare Bird payload with aircraft, observer_context, reference, output_schema...}
### Output JSON
The repository script scripts/collect_socal_aircraft_dataset.py contains the
canonical make_prompt() function used to build the full payload.
Evaluation
Merged Hugging Face checkpoint before MLX conversion:
- Eval examples: 150
- Strict accuracy: 0.9867
- F1: 0.9875
- Precision: 1.0
- Recall: 0.9753
- Invalid JSON: 0
MLX 4-bit regional contrast eval:
- Eval examples: 8
- Accuracy: 1.0
- Invalid JSON: 0
The regional contrast eval focuses on the important local-context behavior: military aircraft can be alert-worthy away from a base pattern but routine near Los Alamitos, March ARB, Edwards, Palmdale, or similar local training/test patterns.
Usage With MLX
mlx_lm.generate \
--model rare-bird-gemma4-e2b-mlx-4bit \
--prompt - \
--ignore-chat-template \
--max-tokens 120 \
--temp 0
For local iOS simulator testing, the Rare Bird repo includes a development bridge:
python scripts/serve_mlx_rarity_model.py \
--model model/output/rarity-gemma4-oc-la-hard-v2-mlx-4bit \
--host 127.0.0.1 \
--port 8765
The simulator app calls http://127.0.0.1:8765/classify. This is a development
bridge only; the shipping app should use an on-device MLX or LiteRT runtime.
Intended Use
This model is intended for:
- local/offline aircraft-rarity classification prototypes
- Rare Bird iPhone app development
- evaluating regional rarity logic for plane spotting
It is not intended for:
- aviation safety or operational air traffic decisions
- real-time navigation
- regulatory, law-enforcement, or emergency use
Limitations
- Rarity is contextual and changes as aircraft retire, move operators, or change routes.
- The model depends on normalized aircraft fields and regional observer context.
- The 4-bit model is optimized for size. The BF16 MLX conversion produced cleaner explanations in some cases but is too large for the current app target.
- The model should be paired with deterministic product guardrails for notification cooldowns, user preferences, and claimability.
Provenance
Built by the Rare Bird project from a fine-tuned google/gemma-4-E2B-it
checkpoint trained on synthetic and real Southern California aircraft rarity
examples.
- Downloads last month
- 15
4-bit