Text Generation
Transformers
Safetensors
English
qwen3_5
image-text-to-text
szl-holdings
series-a
doctrine-v11
governed-ai
proposal-only
conversational
Instructions to use SZLHOLDINGS/chaski with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SZLHOLDINGS/chaski with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SZLHOLDINGS/chaski") 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)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("SZLHOLDINGS/chaski") model = AutoModelForMultimodalLM.from_pretrained("SZLHOLDINGS/chaski", 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SZLHOLDINGS/chaski with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SZLHOLDINGS/chaski" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SZLHOLDINGS/chaski", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SZLHOLDINGS/chaski
- SGLang
How to use SZLHOLDINGS/chaski 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 "SZLHOLDINGS/chaski" \ --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": "SZLHOLDINGS/chaski", "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 "SZLHOLDINGS/chaski" \ --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": "SZLHOLDINGS/chaski", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SZLHOLDINGS/chaski with Docker Model Runner:
docker model run hf.co/SZLHOLDINGS/chaski
feat(train): Qwen3.5-0.8B Apache (license lock), receiptagent knobs
Browse files- train_chaski.py +17 -18
train_chaski.py
CHANGED
|
@@ -11,15 +11,9 @@
|
|
| 11 |
# "trackio",
|
| 12 |
# ]
|
| 13 |
# ///
|
| 14 |
-
"""Chaski training —
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
- Loss is TRL CE + Unsloth train_on_responses_only. No Λ / locked-8 / loop-tax term.
|
| 18 |
-
- Λ uniqueness is Conjecture 1 (identity curriculum only).
|
| 19 |
-
- Doctrine v11 LOCKED 749/14/163 @ c7c0ba17 (identity curriculum only).
|
| 20 |
-
- seed 11, lr 2e-4, adamw_8bit, wd 0.01, LoRA r=16 α=16 (1.5B card).
|
| 21 |
-
- Brain/A11oy corpus excluded.
|
| 22 |
-
- Evals only if a held-out gate actually runs. This job records training MEASURED; eval is none-this-run.
|
| 23 |
"""
|
| 24 |
from __future__ import annotations
|
| 25 |
|
|
@@ -34,14 +28,15 @@ from unsloth import FastLanguageModel
|
|
| 34 |
from unsloth.chat_templates import train_on_responses_only
|
| 35 |
from trl import SFTConfig, SFTTrainer
|
| 36 |
|
| 37 |
-
MAX_SEQ_LEN =
|
| 38 |
-
BASE = os.environ.get("BASE_MODEL", "unsloth/
|
| 39 |
-
CANONICAL_BASE = "Qwen/
|
| 40 |
HUB = os.environ.get("HUB_MODEL_ID", "SZLHOLDINGS/chaski")
|
| 41 |
DATASET = "SZLHOLDINGS/szl-1-doctrine-sft"
|
| 42 |
SEED = 11
|
| 43 |
LORA_R = 16
|
| 44 |
-
LORA_ALPHA =
|
|
|
|
| 45 |
|
| 46 |
OUROBOROS = [
|
| 47 |
{
|
|
@@ -115,8 +110,8 @@ trainer = SFTTrainer(
|
|
| 115 |
max_seq_length=MAX_SEQ_LEN,
|
| 116 |
args=SFTConfig(
|
| 117 |
per_device_train_batch_size=1,
|
| 118 |
-
gradient_accumulation_steps=
|
| 119 |
-
|
| 120 |
warmup_steps=6,
|
| 121 |
learning_rate=2e-4,
|
| 122 |
logging_steps=1,
|
|
@@ -127,7 +122,7 @@ trainer = SFTTrainer(
|
|
| 127 |
output_dir="outputs",
|
| 128 |
report_to="trackio",
|
| 129 |
project="szl-chaski",
|
| 130 |
-
run_name="chaski-
|
| 131 |
push_to_hub=True,
|
| 132 |
hub_model_id=HUB,
|
| 133 |
hub_private_repo=False,
|
|
@@ -150,7 +145,10 @@ print(f"[chaski] train done loss={loss} metrics={metrics}")
|
|
| 150 |
adapter_dir = "chaski-adapter"
|
| 151 |
model.save_pretrained(adapter_dir)
|
| 152 |
tokenizer.save_pretrained(adapter_dir)
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
api = HfApi()
|
| 156 |
receipt = {
|
|
@@ -158,13 +156,14 @@ receipt = {
|
|
| 158 |
"schema": "szl.frontier-training-run/v1",
|
| 159 |
"artifact": HUB,
|
| 160 |
"base_model": CANONICAL_BASE,
|
|
|
|
| 161 |
"base_model_runtime": BASE,
|
| 162 |
"dataset": DATASET,
|
| 163 |
"dataset_sha256": doctrine_sha,
|
| 164 |
"extra_identity_turns": len(OUROBOROS),
|
| 165 |
"training_rows": len(rows),
|
| 166 |
"seed": SEED,
|
| 167 |
-
"
|
| 168 |
"warmup_steps": 6,
|
| 169 |
"lora_r": LORA_R,
|
| 170 |
"lora_alpha": LORA_ALPHA,
|
|
|
|
| 11 |
# "trackio",
|
| 12 |
# ]
|
| 13 |
# ///
|
| 14 |
+
"""Chaski training — Qwen3.5-0.8B Apache (ATELIER license lock 28 Aug 2026).
|
| 15 |
+
Receiptagent pattern: response-only CE. No Λ / locked-8 / loop-tax in the loss.
|
| 16 |
+
Evals none-this-run (no fabricated 5/5).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
"""
|
| 18 |
from __future__ import annotations
|
| 19 |
|
|
|
|
| 28 |
from unsloth.chat_templates import train_on_responses_only
|
| 29 |
from trl import SFTConfig, SFTTrainer
|
| 30 |
|
| 31 |
+
MAX_SEQ_LEN = 2048
|
| 32 |
+
BASE = os.environ.get("BASE_MODEL", "unsloth/Qwen3.5-0.8B")
|
| 33 |
+
CANONICAL_BASE = "Qwen/Qwen3.5-0.8B"
|
| 34 |
HUB = os.environ.get("HUB_MODEL_ID", "SZLHOLDINGS/chaski")
|
| 35 |
DATASET = "SZLHOLDINGS/szl-1-doctrine-sft"
|
| 36 |
SEED = 11
|
| 37 |
LORA_R = 16
|
| 38 |
+
LORA_ALPHA = 32
|
| 39 |
+
MAX_STEPS = 64
|
| 40 |
|
| 41 |
OUROBOROS = [
|
| 42 |
{
|
|
|
|
| 110 |
max_seq_length=MAX_SEQ_LEN,
|
| 111 |
args=SFTConfig(
|
| 112 |
per_device_train_batch_size=1,
|
| 113 |
+
gradient_accumulation_steps=2,
|
| 114 |
+
max_steps=MAX_STEPS,
|
| 115 |
warmup_steps=6,
|
| 116 |
learning_rate=2e-4,
|
| 117 |
logging_steps=1,
|
|
|
|
| 122 |
output_dir="outputs",
|
| 123 |
report_to="trackio",
|
| 124 |
project="szl-chaski",
|
| 125 |
+
run_name="chaski-qwen35-0.8b-doctrine-v1",
|
| 126 |
push_to_hub=True,
|
| 127 |
hub_model_id=HUB,
|
| 128 |
hub_private_repo=False,
|
|
|
|
| 145 |
adapter_dir = "chaski-adapter"
|
| 146 |
model.save_pretrained(adapter_dir)
|
| 147 |
tokenizer.save_pretrained(adapter_dir)
|
| 148 |
+
try:
|
| 149 |
+
model.save_pretrained_merged("chaski-merged", tokenizer, save_method="merged_16bit")
|
| 150 |
+
except Exception as exc:
|
| 151 |
+
print(f"[chaski] merge skipped: {type(exc).__name__}: {exc}")
|
| 152 |
|
| 153 |
api = HfApi()
|
| 154 |
receipt = {
|
|
|
|
| 156 |
"schema": "szl.frontier-training-run/v1",
|
| 157 |
"artifact": HUB,
|
| 158 |
"base_model": CANONICAL_BASE,
|
| 159 |
+
"base_model_relation": "adapter",
|
| 160 |
"base_model_runtime": BASE,
|
| 161 |
"dataset": DATASET,
|
| 162 |
"dataset_sha256": doctrine_sha,
|
| 163 |
"extra_identity_turns": len(OUROBOROS),
|
| 164 |
"training_rows": len(rows),
|
| 165 |
"seed": SEED,
|
| 166 |
+
"max_steps": MAX_STEPS,
|
| 167 |
"warmup_steps": 6,
|
| 168 |
"lora_r": LORA_R,
|
| 169 |
"lora_alpha": LORA_ALPHA,
|