Instructions to use MityaLabs/nafanya-1.7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use MityaLabs/nafanya-1.7b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B") model = PeftModel.from_pretrained(base_model, "MityaLabs/nafanya-1.7b") - MLX
How to use MityaLabs/nafanya-1.7b with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download MityaLabs/nafanya-1.7b --local-dir nafanya-1.7b
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use MityaLabs/nafanya-1.7b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf MityaLabs/nafanya-1.7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf MityaLabs/nafanya-1.7b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf MityaLabs/nafanya-1.7b:Q4_K_M # Run inference directly in the terminal: llama cli -hf MityaLabs/nafanya-1.7b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf MityaLabs/nafanya-1.7b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf MityaLabs/nafanya-1.7b:Q4_K_M
Use Docker
docker model run hf.co/MityaLabs/nafanya-1.7b:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use MityaLabs/nafanya-1.7b with Ollama:
ollama run hf.co/MityaLabs/nafanya-1.7b:Q4_K_M
- Unsloth Desktop
- Pi
How to use MityaLabs/nafanya-1.7b with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "MityaLabs/nafanya-1.7b"
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": "MityaLabs/nafanya-1.7b" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use MityaLabs/nafanya-1.7b with Docker Model Runner:
docker model run hf.co/MityaLabs/nafanya-1.7b:Q4_K_M
- Lemonade
How to use MityaLabs/nafanya-1.7b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull MityaLabs/nafanya-1.7b:Q4_K_M
Run and chat with the model
lemonade run user.nafanya-1.7b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use MityaLabs/nafanya-1.7b 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 "MityaLabs/nafanya-1.7b"
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 MityaLabs/nafanya-1.7b
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use MityaLabs/nafanya-1.7b with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "MityaLabs/nafanya-1.7b"
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 "MityaLabs/nafanya-1.7b" \ --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"
nafanya-1.7b
A compact Russian tool-calling model for the offline kuzya agent on a phone
(Poco F1, skladenOS). Fine-tuned from Qwen/Qwen3-1.7B with LoRA on synthetic
teacher-generated data; runs as GGUF Q4_K_M through llama-server.
nafanya is the model; kuzya is the agent that runs it. The agent, its tools and its rules live in a separate repository.
What it is
- Base:
Qwen/Qwen3-1.7B(Apache-2.0). - Training: MLX-LM BF16 LoRA, 8 last layers, rank 16, scale 16, dropout 0.05, 100 iterations, batch 1, max sequence 1280.
- Prompt during training: compact system prompt plus one-line tool descriptions (1118 tokens, 13 tools: battery, Wi-Fi status/connect, services list, service logs, service restart, sleep inhibit, volume get/set/step, mute, brightness set/step).
- Data: ~610 synthetic Russian requests and refusals, generated by DeepSeek V4.1 Flash (AI-generated), filtered against the agent's frozen test sets.
- Artifacts here: PEFT LoRA adapter and GGUF Q4_K_M.
Evaluation
temperature 0, compact prompt, GGUF Q4_K_M. Sets are Russian tool-selection queries
with exact expected tool and arguments.
| Set | Correct tool | With arguments |
|---|---|---|
| frozen 148-query set | 131/148 (89%) | 125/148 (84%) |
| held-out 40 (v2) | 33/40 (82%) | 32/40 (80%) |
| held-out 40 (v3) | 32/40 (80%) | 27/40 (68%) |
| held-out 40 (v4) | โ | โ |
With the kuzya rules layer (deterministic pre-routing and argument repair in the agent, not in these weights) the same model scores 98โ100% on the fresh sets: 40/40 on held-out v4 and v3 and 40/40 on v2. Do not attribute those numbers to the weights alone.
Phone (Poco F1, Q4_K_M): peak RAM 1.71 GB, load 3โ4 s, warm energy 8.9 J per query with rules (30.7 J without rules), mean 2.4 s per query with rules.
Limitations
- Relative vs absolute volume and brightness ("ะฟะพัะธัะต" with a number) is fragile.
mute_setandnosleep_seton/off can be inverted without the agent rules.- A line count can be mistaken for a service name in
service_logs. - Out-of-scope requests (Wi-Fi on/off, ssh/sshd, "all services", arithmetic) may produce a tool call; the agent's allowlist and rules catch them.
- Evaluated only on Russian queries and only on one phone model.
Data and licence
- Weights: Apache-2.0 (same as the base model).
- Training data is synthetic, generated by DeepSeek V4.1 Flash through its API under the DeepSeek Open Platform Terms of Service (release 2026-04-22, ยง4.2(3), which permits using outputs to train other models). It is AI-generated; no data from the phone, no personal data.
- DeepSeek is mentioned only as the data source; this model is not affiliated with or endorsed by DeepSeek.
Links
- Agent: https://github.com/mitya-labs/kuzya
- Training workspace: https://github.com/mitya-labs/nafanya
- Downloads last month
- 45