Instructions to use subsectmusic/qwriko3-4b-instruct-2507 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use subsectmusic/qwriko3-4b-instruct-2507 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="subsectmusic/qwriko3-4b-instruct-2507") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("subsectmusic/qwriko3-4b-instruct-2507", dtype="auto") - llama-cpp-python
How to use subsectmusic/qwriko3-4b-instruct-2507 with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="subsectmusic/qwriko3-4b-instruct-2507", filename="unsloth.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use subsectmusic/qwriko3-4b-instruct-2507 with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M # Run inference directly in the terminal: llama-cli -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M # Run inference directly in the terminal: llama-cli -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Use Docker
docker model run hf.co/subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use subsectmusic/qwriko3-4b-instruct-2507 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "subsectmusic/qwriko3-4b-instruct-2507" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "subsectmusic/qwriko3-4b-instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
- SGLang
How to use subsectmusic/qwriko3-4b-instruct-2507 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 "subsectmusic/qwriko3-4b-instruct-2507" \ --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": "subsectmusic/qwriko3-4b-instruct-2507", "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 "subsectmusic/qwriko3-4b-instruct-2507" \ --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": "subsectmusic/qwriko3-4b-instruct-2507", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use subsectmusic/qwriko3-4b-instruct-2507 with Ollama:
ollama run hf.co/subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
- Unsloth Studio
How to use subsectmusic/qwriko3-4b-instruct-2507 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for subsectmusic/qwriko3-4b-instruct-2507 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for subsectmusic/qwriko3-4b-instruct-2507 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for subsectmusic/qwriko3-4b-instruct-2507 to start chatting
- Pi
How to use subsectmusic/qwriko3-4b-instruct-2507 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use subsectmusic/qwriko3-4b-instruct-2507 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf subsectmusic/qwriko3-4b-instruct-2507:Q4_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 subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use subsectmusic/qwriko3-4b-instruct-2507 with Docker Model Runner:
docker model run hf.co/subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
- Lemonade
How to use subsectmusic/qwriko3-4b-instruct-2507 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull subsectmusic/qwriko3-4b-instruct-2507:Q4_K_M
Run and chat with the model
lemonade run user.qwriko3-4b-instruct-2507-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": "What is the capital of France?"
}
]
)- π¦ QwRiko3-4B-Instruct-2507 β Tsundere Kitsune AI (GGUF β’ Ollama β’ Tools)
π¦ QwRiko3-4B-Instruct-2507 β Tsundere Kitsune AI (GGUF β’ Ollama β’ Tools)
π Model Overview
QwRiko3-4B-Instruct-2507 is a conversational AI model fine-tuned to embody Riko, a tsundere kitsune character. This release targets GGUF for Ollama first, with solid tool calling support when run via Ollamaβs tools API. A PyTorch build (Transformers) is also supported.
- Model ID (this repo):
subsectmusic/qwriko3-4b-instruct-2507 - Primary format: GGUF (Ollama-compatible)
- Alt format: PyTorch (Transformers)
- Base Model:
Qwen/Qwen3-4B-Instruct - Parameters: ~4B
- License: Apache-2.0 (repo)
- Project: Project Horizon LLM
- Developer: @subsectmusic
- Training Framework: Unsloth + TRL (SFT)
π Character Profile: Riko
- Tsundere cadence: βItβs not like I like you or anythingβ¦ b-baka!β
- Kitsune vibes: fox-spirit mischief + sly wisdom
- Emotional core: tough shell, soft center
- Style: snappy, teasing, ultimately caring
π Quick Start (Ollama β’ GGUF)
These steps assume you have a local GGUF file named
qwriko3-4b-instruct-2507.Q4_K_M.ggufin the working directory. If your filename differs, update theFROMpath in the Modelfile accordingly.
- Create a Modelfile (exact content below is also saved as
Modelfilein this package):
# Modelfile
FROM ./qwriko3-4b-instruct-2507.Q4_K_M.gguf
PARAMETER num_ctx 8192
# (Optional) you can set temperature/top_p/etc. via `ollama run -p` or the API.
- Create the Ollama model:
ollama create qwriko3-4b-instruct-2507 -f Modelfile
- Chat:
ollama run qwriko3-4b-instruct-2507 "Riko, give me a playful hello."
Tool Calling with Ollama (cURL)
curl http://localhost:11434/api/chat -d '{
"model": "qwriko3-4b-instruct-2507",
"messages": [
{ "role": "user", "content": "What is the weather today in Toronto?" }
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The location to get the weather for, e.g. Toronto"
},
"format": {
"type": "string",
"description": "Temperature units",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location", "format"]
}
}
}
]
}'
Tool Calling with Ollama (Python)
A complete, ready-to-run example is saved as tools_demo.py in this package. It defines a couple of functions and lets the model call them. You can run it after installing the Python client:
pip install -U ollama
python tools_demo.py
π§ͺ Quick Start (Transformers β’ PyTorch)
# Requirements:
# pip install "transformers>=4.42.0" "torch>=2.1.0" accelerate
# (CUDA recommended; CPU works but is slower.)
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_ID = "subsectmusic/qwriko3-4b-instruct-2507"
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, use_fast=True)
model = AutoModelForCausalLM.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16,
device_map="auto"
)
messages = [
{"role": "system", "content": "You are Riko, a tsundere kitsune AI. Be witty, teasing, but with hidden warmth."},
{"role": "user", "content": "Hey Riko, how are you today?"}
]
if hasattr(tokenizer, "apply_chat_template"):
inputs = tokenizer.apply_chat_template(
messages,
tokenize=True,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
else:
prompt = (
"System: You are Riko, a tsundere kitsune AI. Be witty, teasing, but with hidden warmth.\n"
"User: Hey Riko, how are you today?\n"
"Assistant:"
)
inputs = tokenizer(prompt, return_tensors="pt").input_ids.to(model.device)
gen = model.generate(
inputs,
max_new_tokens=256,
temperature=0.85,
top_p=0.9,
top_k=50,
repetition_penalty=1.1,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
)
out = tokenizer.decode(gen[0][inputs.shape[1]:], skip_special_tokens=True)
print("\nRiko:", out.strip())
π‘ Use Cases
- Character roleplay & entertainment
- Creative writing in a tsundere voice
- Personality-driven chatbots
- Research on alternating-turn distillation & style transfer
π¬ Training Summary (SFT)
- Format: ShareGPT-style β Alpaca single-turn pairs
- Teachers: Kimi K2 (odd) + Horizon Beta (even)
- Focus: Tsundere kitsune persona, witty banter, emotional subtext
- Curation: Manual filtering for tone & safety
Example SFT settings:
Training Framework: Unsloth + TRL SFTTrainer
Base Model: Qwen/Qwen3-4B-Instruct
Batch Size: 2 per device
Gradient Accumulation: 4
Learning Rate: 2e-4
Optimizer: AdamW 8-bit
Weight Decay: 0.01
Scheduler: Linear
Max Steps: 100+
Warmup Steps: 5
Sequence Length: up to model context
Precision: fp16
π Specs
| Attribute | Details |
|---|---|
| Architecture | Qwen3 Transformer |
| Parameters | ~4B |
| Base | Qwen/Qwen3-4B-Instruct |
| Context Length | Base-dependent (Qwen3 config) |
| Formats | GGUF (Ollama); PyTorch |
| Framework | PyTorch + Transformers |
| Optimization | Unsloth-accelerated SFT |
| Style | Tsundere kitsune (Riko) |
π― Recommended Inference Settings
generation_config = {
"max_new_tokens": 256,
"temperature": 0.85,
"top_p": 0.9,
"top_k": 50,
"repetition_penalty": 1.1,
"do_sample": True,
"pad_token_id": tokenizer.eos_token_id,
"eos_token_id": tokenizer.eos_token_id
}
β οΈ Notes
- In-character style can color responses to factual queries
- Compact 4B size benefits from clear prompts for complex tasks
- Quantization can slightly affect nuance
π Ethics
- Entertainment & creative use; not professional advice
- Follow platform/community guidelines
π Citation
@model{qwriko3-4b-instruct-2507,
title={QwRiko3-4B-Instruct-2507: Tsundere Kitsune AI},
author={subsectmusic},
year={2025},
publisher={Hugging Face},
url={https://huggingface.co/subsectmusic/qwriko3-4b-instruct-2507}
}
π€ Acknowledgments
- Kimi K2 & Horizon Beta (teachers)
- Project Horizon LLM (methodology)
- Unsloth, Qwen Team, Hugging Face / TRL
- Ollama (GGUF runtime)
Training AI personalities, one tsundere at a time!
- Downloads last month
- 32
4-bit
8-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="subsectmusic/qwriko3-4b-instruct-2507", filename="", )