Instructions to use Yuri-OS/YuriCore-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Yuri-OS/YuriCore-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yuri-OS/YuriCore-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Yuri-OS/YuriCore-9B") model = AutoModelForMultimodalLM.from_pretrained("Yuri-OS/YuriCore-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Yuri-OS/YuriCore-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Yuri-OS/YuriCore-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Yuri-OS/YuriCore-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Yuri-OS/YuriCore-9B
- SGLang
How to use Yuri-OS/YuriCore-9B 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 "Yuri-OS/YuriCore-9B" \ --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": "Yuri-OS/YuriCore-9B", "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 "Yuri-OS/YuriCore-9B" \ --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": "Yuri-OS/YuriCore-9B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Yuri-OS/YuriCore-9B with Docker Model Runner:
docker model run hf.co/Yuri-OS/YuriCore-9B
# pip install -U transformers accelerate
# Load model directly
from transformers import AutoProcessor, AutoModelForMultimodalLM
processor = AutoProcessor.from_pretrained("Yuri-OS/YuriCore-9B")
model = AutoModelForMultimodalLM.from_pretrained("Yuri-OS/YuriCore-9B", device_map="auto")
messages = [
{
"role": "user",
"content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "What animal is on the candy?"}
]
},
]
inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))YuriCore-9B
YuriCore-9B is a 9B-parameter companion roleplay and tool-use model fine-tuned for the YuriOS companion runtime. It is built on petruhonk/Qwen3.8-9B-Distill-uncensored-heretic (the hybrid Gated-DeltaNet Qwen3.5-9B architecture) and requires transformers >= 5.
- GGUF quantizations (
Q8_0,Q4_K_M): Yuri-OS/YuriCore-9B-GGUF
Highlights
- In-character roleplay with
<think>reasoning: Preserves natural character voice and narrative continuity while using structured<think>...</think>reasoning before replying. Formats physical actions with*asterisks*(TTS-friendly) rather than bracketed narration. - Grounded tool use & abstention: Trained for inline
[[tool ...]]calls, multi-step tool chains, and clean abstention when a tool is unnecessary, ambiguous, or unavailable. - Outcome honesty: Filtered and trained to avoid fabricating completed actions, invented search results, or delivered images when a tool failed, was denied, or is still pending.
- Long-context & background loops: Trained up to 16,384 tokens for full companion system prompts as well as structured background tasks (reflection/dreaming, goal work, memory updates, and JSON utility outputs).
Training Summary
| Setting | Value |
|---|---|
| Base model | petruhonk/Qwen3.8-9B-Distill-uncensored-heretic |
| Architecture | Qwen3.5-9B hybrid Gated-DeltaNet + full attention |
| Method | BF16 rsLoRA (r=32, alpha=32) merged into BF16 weights |
| Target modules | All 248 attention, Gated-DeltaNet (in_proj_qkv/z/a/b, out_proj), and MLP projections |
| Loss masking | Final assistant turn only (<think> + reply) |
| Context length | 16,384 tokens |
| Schedule | 1 epoch, lr=1e-4, effective batch size 16 |
| Dataset size | 20,206 train / 407 validation examples (English) |
The training mixture combines curated roleplay datasets (CoSER, filtered PIPPA, character archetypes), function-calling and abstention data (ToolACE, When2Call, Hermes-style tasks), and multi-turn YuriOS tool and background-loop episodes with automated filters for clock/date accuracy, leaked instructions, and hallucinated tool outcomes.
Internal Evaluation Summary
Evaluated via llama.cpp / LM Studio GGUF builds on YuriOS's internal benchmark suites:
| Suite | YuriCore-9B (Q8_0) |
YuriCore-9B (Q4_K_M) |
|---|---|---|
Tool & abstention (cases_v5c, 252 scored) |
87% (218/252) | โ |
| Held-out blind tool suite (21 cases) | 95% (20/21) | 90% (19/21) |
| Result-bearing outcome suite (68 cases) | 84% (57/68) | 74% (50/68) |
| Background loops (45 cases) | 93% (42/45) | 87% (39/45) |
| Roleplay judge (12 sessions, 0โ100) | 91.8 | โ |
Usage
Transformers (transformers >= 5)
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "Yuri-OS/YuriCore-9B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
messages = [
{"role": "system", "content": "You are a warm, witty companion."},
{"role": "user", "content": "Hey, what should we cook tonight?"},
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=512, temperature=0.7, top_p=0.9)
print(tokenizer.decode(output[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Local Inference (GGUF)
For LM Studio, llama.cpp, or Ollama, see Yuri-OS/YuriCore-9B-GGUF.
License & Acknowledgments
Released under Apache 2.0 (inherited from the Qwen3.5 / base model lineage).
Thanks to the Qwen team, petruhonk for the base distill checkpoint, the creators of CoSER, PIPPA, ToolACE, and When2Call, and the Unsloth / TRL / llama.cpp ecosystems.
- Downloads last month
- 207
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Yuri-OS/YuriCore-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)