Instructions to use issai/Qwen3.5-9B-Kazakh with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use issai/Qwen3.5-9B-Kazakh with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="issai/Qwen3.5-9B-Kazakh") 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("issai/Qwen3.5-9B-Kazakh") model = AutoModelForMultimodalLM.from_pretrained("issai/Qwen3.5-9B-Kazakh", 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 issai/Qwen3.5-9B-Kazakh with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "issai/Qwen3.5-9B-Kazakh" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "issai/Qwen3.5-9B-Kazakh", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/issai/Qwen3.5-9B-Kazakh
- SGLang
How to use issai/Qwen3.5-9B-Kazakh 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 "issai/Qwen3.5-9B-Kazakh" \ --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": "issai/Qwen3.5-9B-Kazakh", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "issai/Qwen3.5-9B-Kazakh" \ --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": "issai/Qwen3.5-9B-Kazakh", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use issai/Qwen3.5-9B-Kazakh with Docker Model Runner:
docker model run hf.co/issai/Qwen3.5-9B-Kazakh
Qwen3.5-9B-Kazakh
Qwen3.5-9B-Kazakh is a Kazakh adaptation of Qwen/Qwen3.5-9B. It extends the tokenizer with an additional Kazakh vocabulary for more efficient tokenization, is continued-pretrained on Kazakh text, and is then re-aligned to the official instruct model. This makes the model more efficient on Kazakh text and adds knowledge, while preserving the capabilities of the base model.
Methodology
This model is produced in two stages on top of our Kazakh continued-pretraining model
issai/Qwen3.5-9B-Base-Kazakh, the official
Qwen/Qwen3.5-9B-Base continued-pretrained on Kazakh text with a
+16K Kazakh-token vocabulary extension. No additional post-training (SFT, RLHF, or RLVR) is used.
1. Chat-vector merge, transferring instruct alignment
We transfer the instruction-following / chat alignment of the official post-trained model using the chat vector method (Huang et al., 2024). Let
θ_inst: weights of the official post-trainedQwen/Qwen3.5-9Bθ_base: weights of the official baseQwen/Qwen3.5-9B-Baseθ_cpt: weights of our Kazakh base modelissai/Qwen3.5-9B-Base-Kazakh
The chat vector is the task vector of post-training,
and it is added to our Kazakh continued-pretraining model:
applied per parameter tensor, by name. Because our tokenizer is vocabulary-extended, the
input-embedding and output (lm_head) matrices are merged row-wise: the shared
original-vocabulary rows receive the chat vector, while the 16K new Kazakh-token rows are
kept from θ_cpt (the official models have no counterpart for them). embed_tokens and lm_head are untied and are merged independently.
Special-token pinning. The rows of the format-control special tokens
<think>, </think>, <|im_start|>, <|im_end|> and <|endoftext|> (in both the
embedding and lm_head) are set to the official post-trained model's exact values
instead of the merged values. These few rows drive the chat template's control flow (emitting </think> to close the
reasoning block and <|im_end|> to end the turn). The raw chat vector otherwise detunes
them and breaks this template logic, causing the model to loop and never terminate. Pinning them restores reliable termination
while preserving the Kazakh knowledge acquired during continued pretraining.
2. Vision re-integration, restoring multimodality
Because our continued pretraining was performed on text only, with the vision branch removed beforehand, the chat-vector merge operates on the language model and produces a text-only model. To
restore image and video understanding, the vision encoder and multimodal projector from
the official Qwen/Qwen3.5-9B are re-attached to this Kazakh-adapted,
instruct-aligned language backbone, and the architecture is set back to
Qwen3_5ForConditionalGeneration. The result is a multimodal model that largely preserves the official model's vision
capabilities while its language model handles Kazakh (and English) with instruct-style
alignment and correct <think>...</think> reasoning.
Evaluation
We evaluate Qwen3.5-9B-Kazakh against its base model Qwen3.5-9B on Kazakh and English benchmarks under identical settings (thinking mode enabled):
temperature = 1.0top_p = 0.95top_k = 20presence_penalty = 1.5max_tokens = 81920
Scores are accuracy (%).
⚠️ Note on vision benchmarks. The merged model was not explicitly trained on vision tasks, which accounts for some degradation on the vision benchmarks. These results can be further improved with dedicated vision-language finetuning.
Kazakh
The Kazakh benchmarks (most of which are available in the ISSAI Qolda suite: language, vision) use Kazakh questions and answer choices. KazMMLU and KazCulture are native Kazakh benchmarks; the rest are Kazakh adaptations of the standard benchmarks.
Text
|
Vision
|
English
Text
|
Vision
|
Model usage
The following package versions are used:
transformers>=5.12.1- a recent
torchbuild (matching your CUDA) vllm>=0.24.0(for serving)- optional:
flash-linear-attentionandcausal-conv1dfor faster linear-attention inference
The model reasons by default, emitting a chain-of-thought inside <think> ... </think>.
Transformers
from transformers import AutoProcessor, AutoModelForMultimodalLM
model_id = "issai/Qwen3.5-9B-Kazakh"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(model_id, dtype="auto", device_map="auto")
messages = [
{"role": "user", "content": [{"type": "text", "text": "Балқаш көлінің қандай ерекшелігі бар?"}]}
]
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=32768,
do_sample=True, temperature=1.0, top_p=0.95, top_k=20,
)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Image input:
messages = [
{"role": "user", "content": [
{"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
{"type": "text", "text": "Суретте не бейнеленген?"},
]}
]
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=32768,
do_sample=True, temperature=1.0, top_p=0.95, top_k=20,
)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
To disable thinking, pass enable_thinking=False to apply_chat_template.
vLLM
Serve an OpenAI-compatible endpoint:
vllm serve issai/Qwen3.5-9B-Kazakh \
--served-model-name qwen \
--reasoning-parser qwen3 \
--max-model-len 90000
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
resp = client.chat.completions.create(
model="qwen",
messages=[{"role": "user", "content": """Төмендегі экзопланеталардың қайсысында тығыздығы ең жоғары?
a) Жермен бірдей құрамы бар, бірақ Жерден 5 есе ауыр планета.
b) Жермен бірдей құрамды, бірақ Жерден екі есе жеңіл планета.
c) Массасы Жерден 2 есе үлкен және тығыздығы шамамен 5.5 г/см^3 болатын планета.
d) Жердің массасы мен радиусымен тең планета."""}],
max_tokens=81920, temperature=1.0, top_p=0.95, presence_penalty=1.5,
extra_body={"top_k": 20},
)
print(resp.choices[0].message.reasoning) # chain-of-thought
print(resp.choices[0].message.content) # final answer
Image input:
import base64
image = base64.b64encode(open("image.png", "rb").read()).decode()
resp = client.chat.completions.create(
model="qwen",
messages=[{"role": "user", "content": [
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image}"}},
{"type": "text", "text": "Суретте қандай фигуралар бар?"},
]}],
max_tokens=81920, temperature=1.0, top_p=0.95, presence_penalty=1.5,
extra_body={"top_k": 20},
)
print(resp.choices[0].message.content)
To disable thinking, add "chat_template_kwargs": {"enable_thinking": false} to extra_body.
License
This model is released under the Apache 2.0 license, inherited from the original Qwen3.5 model.
- Downloads last month
- 172