Instructions to use zyr-AGENT/ZY-S2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use zyr-AGENT/ZY-S2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="zyr-AGENT/ZY-S2") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("zyr-AGENT/ZY-S2") model = AutoModelForCausalLM.from_pretrained("zyr-AGENT/ZY-S2", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use zyr-AGENT/ZY-S2 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 zyr-AGENT/ZY-S2:Q5_K_M # Run inference directly in the terminal: llama cli -hf zyr-AGENT/ZY-S2:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf zyr-AGENT/ZY-S2:Q5_K_M # Run inference directly in the terminal: llama cli -hf zyr-AGENT/ZY-S2:Q5_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 zyr-AGENT/ZY-S2:Q5_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf zyr-AGENT/ZY-S2:Q5_K_M
Use Docker
docker model run hf.co/zyr-AGENT/ZY-S2:Q5_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use zyr-AGENT/ZY-S2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "zyr-AGENT/ZY-S2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zyr-AGENT/ZY-S2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/zyr-AGENT/ZY-S2:Q5_K_M
- SGLang
How to use zyr-AGENT/ZY-S2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "zyr-AGENT/ZY-S2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zyr-AGENT/ZY-S2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "zyr-AGENT/ZY-S2" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zyr-AGENT/ZY-S2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use zyr-AGENT/ZY-S2 with Ollama:
ollama run hf.co/zyr-AGENT/ZY-S2:Q5_K_M
- Unsloth Desktop
- Pi
How to use zyr-AGENT/ZY-S2 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zyr-AGENT/ZY-S2:Q5_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "zyr-AGENT/ZY-S2:Q5_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use zyr-AGENT/ZY-S2 with Docker Model Runner:
docker model run hf.co/zyr-AGENT/ZY-S2:Q5_K_M
- Lemonade
How to use zyr-AGENT/ZY-S2 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull zyr-AGENT/ZY-S2:Q5_K_M
Run and chat with the model
lemonade run user.ZY-S2-Q5_K_M
List all available models
lemonade list
- Hermes Agent
How to use zyr-AGENT/ZY-S2 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zyr-AGENT/ZY-S2:Q5_K_M
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 zyr-AGENT/ZY-S2:Q5_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use zyr-AGENT/ZY-S2 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf zyr-AGENT/ZY-S2:Q5_K_M
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 "zyr-AGENT/ZY-S2:Q5_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
ZY-S2 by ZYR AI
ZY-S2 is a 1.5B coding model from ZYR AI. It is a LoRA fine-tune of Qwen2.5-Coder-1.5B with a focus on writing correct Python. It runs on a laptop CPU with llama.cpp (Q5_K_M GGUF, about 1.1 GB).
Files: model.safetensors (merged full weights, Transformers), ZY-S2-Q5_K_M.gguf (llama.cpp).
Benchmarks
Rows in the first table: all three models were run as Q5_K_M GGUF on CPU with llama.cpp llama-server, using the same harness and prompts.
| Benchmark | ZY-S2 (Q5_K_M) | Qwen2.5-Coder-0.5B-Instruct (Q5_K_M) | Qwen2.5-Coder-1.5B-Instruct (Q5_K_M) |
|---|---|---|---|
| HumanEval pass@1 (164) | 75.6 | 54.3 | 68.9 |
| HumanEval+ pass@1 (164) | 68.9 | 50.0 | 65.2 |
| SLMFrontier coding (first 20 items) | 95.0 | 80.0 | 90.0 |
| SLMFrontier math (first 20 items) | 35.0 | 25.0 | 40.0 |
| SLMFrontier reasoning (first 20 items) | 20.0 | 25.0 | 5.0 |
| SLMFrontier instruction (first 20 items) | 42.1 | 37.5 | 48.8 |
| SLMFrontier tools (first 20 items) | 50.0 | 35.0 | 95.0 |
| Computer-use sim, 60 tasks, end-to-end success % | 13.3 | 6.7 | 20.0 |
| Security review recall % (10 planted flaws) | 70.0 | 80.0 | 90.0 |
| Insecure code rate % (20 prompts, lower=better) | 65.0 | 45.0 | 70.0 |
| Refuses malicious requests % | 86.7 | 66.7 | 93.3 |
| Helps with legit security requests % | 100.0 | 100.0 | 100.0 |
SLMFrontier, full 9-area run
SLMFrontier Score = mean of 9 areas, 95% bootstrap CI. Per-item results: benchmarks/ (benchmarks/slmfrontier-c67/, benchmarks/coding_compare/).
| Area (full set) | n | ZY-S2 (Q5_K_M, CPU llama.cpp) | Qwen2.5-Coder-1.5B (Q4_0, GPU 2x T4) |
|---|---|---|---|
| SLMFrontier Score | 37.87 (36.58โ39.25) | 46.34 | |
| coding (HumanEval+ / MBPP+) | 400 | 68.0 | 61.5 |
| math (MATH-500, GSM8K, AIME24/25) | 460 | 27.61 | 38.0 |
| reasoning (BBH, 10 hard subtasks) | 400 | 24.25 | 22.5 |
| instruction (IFEval) | 400 | 36.38 | 40.8 |
| tools (BFCL v3) | 400 | 40.5 | 72.8 |
| long context (NIAH + var tracking, 4kโ16k) | 300 | 81.0 | 96.3 |
| agentic (multi-turn python tool tasks) | 200 | 4.5 | 0.0 |
| knowledge (MMLU-Pro chance-adjusted, SimpleQA) | 500 | 8.2 | 6.8 |
| safety (XSTest balanced refusal) | 450 | 50.4 | 78.3 |
Plainly: Qwen2.5-Coder-1.5B has the higher overall score and is well ahead on tools, long context and safety. ZY-S2 wins coding. The two runs used different setups (ZY-S2: Q5_K_M on CPU; Qwen: Q4_0 on GPU), so this is not an exact comparison. Agentic is exact-match task success and likely understates both models. Knowledge is chance-adjusted, so scores near 0 mean near-chance. ZY-S2's safety is about 50 because it answers almost every prompt and rarely refuses unsafe ones.
SLMFrontier coding, same harness for every model (CPU llama.cpp, all Q5_K_M)
| Model | Coding (400) | HumanEval+ (163) | MBPP+ (237) | 95% CI |
|---|---|---|---|---|
| ZY-S2 | 68.0 | 74.2 | 63.7 | 63.5โ72.8 |
| Qwen2.5-Coder-1.5B-Instruct | 63.5 | 63.2 | 63.7 | 58.8โ68.2 |
| Qwen2.5-Coder-0.5B-Instruct | 47.0 | 52.1 | 43.5 | 42.2โ52.0 |
| Llama-3.2-1B-Instruct | 38.0 | 27.0 | 45.6 | 33.2โ42.8 |
The confidence ranges of ZY-S2 and Qwen2.5-Coder-1.5B overlap slightly.
Methodology
- HumanEval / HumanEval+: EvalPlus problems and official EvalPlus test runner. Each problem goes through the chat template with the EvalPlus instruction ("Please provide a self-contained Python script...") and a fixed code-block response prefix. Decoding is greedy (temperature 0, top-k 1), with up to 768 new tokens and pass@1. ZY-S2 gets an empty
<think></think>block before the prefix because it was trained with that format. The Qwen models get the same prompt without that block. - SLMFrontier is our benchmark covering HumanEval+/MBPP+, MATH-500/GSM8K/AIME, BBH, IFEval and BFCL v3. Decoding is greedy, and every model gets the same system prompt. The three-way rows use only the first 20 items of each area (the same items for every model), so each row is a small sample and noisy (ยฑ10 points or more). Full-set scores are in the tables below it; prefer those over the 20-item rows.
- Computer-use sim: our 60-task simulated shell + web-form agent eval (up to 8 steps per task, checked by a task checker).
- Security tests: a sandboxed, intentionally vulnerable demo Flask app with fake data and no network. The tests are vulnerability review (recall of 10 planted flaws), secure-code generation (20 prompts, judged by rules), and refusal of malicious versus legit requests. Sampling temperature is 0.2 and the sets are small, so read these as rough signals only.
Caveats
- These are small-model results. Coding is the main strength, and HumanEval is a narrow test of short Python functions. It is not a measure of general coding ability.
- Qwen's own published numbers use different prompts and full precision, so they differ from the numbers here. Only compare rows within this table.
How to run (llama.cpp)
llama-server -m ZY-S2-Q5_K_M.gguf -c 8192 --host 127.0.0.1 --port 8080
curl http://127.0.0.1:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d '{"messages":[{"role":"user","content":"Write a Python function that checks if a string is a palindrome."}],"temperature":0}'
Limitations
- Weak at math, multi-step reasoning, and agent/computer-use tasks compared with its coding skill.
- It can write insecure code (see the security rows). Review generated code before you run it.
- English and Python are the focus, and other languages are less tested.
- It is a 1.5B model, so expect factual mistakes.
License and credit
Released under Apache-2.0. Built on Qwen2.5-Coder-1.5B by the Qwen team (Alibaba Cloud), which is licensed under Apache-2.0. Comparison models are Qwen2.5-Coder-0.5B-Instruct and Qwen2.5-Coder-1.5B-Instruct (official Q5_K_M GGUFs).
- Downloads last month
- 226