Instructions to use viperdevAI/Viperfish-Sunlight-1.5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use viperdevAI/Viperfish-Sunlight-1.5B 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("viperdevAI/Viperfish-Sunlight-1.5B") 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 viperdevAI/Viperfish-Sunlight-1.5B with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "viperdevAI/Viperfish-Sunlight-1.5B"
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": "viperdevAI/Viperfish-Sunlight-1.5B" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use viperdevAI/Viperfish-Sunlight-1.5B with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "viperdevAI/Viperfish-Sunlight-1.5B"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "viperdevAI/Viperfish-Sunlight-1.5B" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8080/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "viperdevAI/Viperfish-Sunlight-1.5B", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use viperdevAI/Viperfish-Sunlight-1.5B 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 "viperdevAI/Viperfish-Sunlight-1.5B"
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 viperdevAI/Viperfish-Sunlight-1.5B
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use viperdevAI/Viperfish-Sunlight-1.5B with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "viperdevAI/Viperfish-Sunlight-1.5B"
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 "viperdevAI/Viperfish-Sunlight-1.5B" \ --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 README.md from viperdevAI/Viperfish-Sunlight-1.5B: direct link, hf CLI and curl.
- Browser
- Download file 2.88 kB
-
https://huggingface.co/viperdevAI/Viperfish-Sunlight-1.5B/resolve/main/README.md
- Command line
-
hf download hf://viperdevAI/Viperfish-Sunlight-1.5B/README.md
-
curl -L -o README.md https://huggingface.co/viperdevAI/Viperfish-Sunlight-1.5B/resolve/main/README.md
license: apache-2.0
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
library_name: mlx
pipeline_tag: text-generation
language:
- en
tags:
- mlx
- swift
- swiftui
- code
- lora
Viperfish Sunlight 1.5B
Sunlight is the smallest model in the Viperfish family of open-weight models. It is a Swift / SwiftUI-focused fine-tune of Qwen2.5-Coder-1.5B-Instruct, small enough to run on an 8 GB Mac.
This repo is the MLX 4-bit build (about 840 MB): the LoRA adapter fused into the 4-bit base. It runs with mlx-lm on Apple Silicon.
Quick start
pip install mlx-lm
from mlx_lm import load, generate
model, tokenizer = load("viperdevAI/Viperfish-Sunlight-1.5B")
messages = [{"role": "user", "content": "Write a SwiftUI view with a counter and an increment button."}]
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512))
Details
- Base model: Qwen/Qwen2.5-Coder-1.5B-Instruct (Apache-2.0), 4-bit MLX quantization. All credit for the base model goes to the Qwen team.
- Method: LoRA (rank 8, scale 20, 16 layers), 6,164 steps at batch size 1, sequence length 1024, learning rate 5e-5 with cosine decay.
- Training data: 6,164 Swift / SwiftUI source files from The Stack v1 (dedup). The dataset is not redistributed here; upstream licenses apply to the original files.
- License: Apache-2.0.
Results
Compared with the base model on my own benchmarks. Swift answers are scored by whether the generated code compiles with swiftc; HumanEval is the standard Python benchmark.
| Model | SwiftUI (60 prompts) | Plain Swift (33 prompts) | HumanEval (164) |
|---|---|---|---|
| Qwen2.5-Coder-1.5B-Instruct (4-bit) | 16 | 13 | 67.7% (111) |
| Viperfish Sunlight 1.5B | 31 | 14 | 56.1% (92) |
SwiftUI roughly doubles. Plain Swift barely moves. Python gets worse.
Limitations
- Python regression: HumanEval drops from 67.7% to 56.1%. If you want a general-purpose coding model, use the base model; Sunlight trades general ability for SwiftUI.
- Training data was raw source code, not chat. The model often stops without closing its final code fence, and long answers may run on.
- It is a 1.5B model: expect mistakes, invented APIs and outdated SwiftUI idioms. Always compile and review generated code.
- Trained only on Swift / SwiftUI; it may not generalize to other languages.
- The benchmark prompt sets are my own and small; treat the numbers as indicative, not definitive.
The Viperfish family
Sunlight 1.5B, Twilight 3B, Midnight 7B and Hadal 14B, named after the ocean's depth zones. More at viperfish.dev.