Instructions to use birgermoell/Qwen3.5-4B-EU-Tool with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use birgermoell/Qwen3.5-4B-EU-Tool with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="birgermoell/Qwen3.5-4B-EU-Tool") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("birgermoell/Qwen3.5-4B-EU-Tool") model = AutoModelForCausalLM.from_pretrained("birgermoell/Qwen3.5-4B-EU-Tool") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use birgermoell/Qwen3.5-4B-EU-Tool with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "birgermoell/Qwen3.5-4B-EU-Tool" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "birgermoell/Qwen3.5-4B-EU-Tool", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/birgermoell/Qwen3.5-4B-EU-Tool
- SGLang
How to use birgermoell/Qwen3.5-4B-EU-Tool 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 "birgermoell/Qwen3.5-4B-EU-Tool" \ --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": "birgermoell/Qwen3.5-4B-EU-Tool", "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 "birgermoell/Qwen3.5-4B-EU-Tool" \ --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": "birgermoell/Qwen3.5-4B-EU-Tool", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use birgermoell/Qwen3.5-4B-EU-Tool with Docker Model Runner:
docker model run hf.co/birgermoell/Qwen3.5-4B-EU-Tool
Qwen3.5-4B-EU-Tool
A European, tool-use-capable post-training of Qwen/Qwen3.5-4B.
It folds function-calling / agentic data into the EU instruction mix, so the model calls tools
in Qwen3.5's native <tool_call> format while keeping European multilingual instruction
following. Defaults to fast no-think answers with a /think reasoning toggle. Part of OpenEuroLLM
Task 4.6, trained on LUMI (AMD MI250X / ROCm).
Tool-calling evaluation (BFCL-style)
A vLLM-free, self-contained function-calling eval (scripts/eval_tool_calling.py): 300 held-out
prompts (150 that require a call + 150 that should not be called), scored on argument-exact
match, function-name match, well-formed output, and relevance (correct abstention):
| Metric | base Qwen3.5-4B | this model (SFT) |
|---|---|---|
| format_valid | 0.993 | 0.98 |
| name_acc | 0.993 | 0.98 |
| args_exact | 0.873 | 0.96 |
| abstain / relevance | 0.807 | 0.84 |
The base is already tool-capable (native support); this post-training's win is argument precision (+8.7 pts args_exact) while improving relevance (knowing when not to call).
A note on RL. A verifiable-reward GRPO stage was also trained, but its
tool_call_exactreward had no abstention component, so it reward-hacked — driving relevance to 0.0 (it always calls). We therefore ship the SFT, not the GRPO. A fixed reward (crediting correct abstention, with no-call examples) is the follow-up.
Training data
Openly-documented European post-training data (no proprietary data). SFT mix (~590k), packed, bf16:
- General EU instructions (EuroBlocks EU-multilingual + Tülu-3 English replay), no-think.
- Reasoning traces (chain-of-thought, think-format) — keeps the
/thinkpath sharp. - Defect-repair (native text for weak EU languages), oversampled.
- Tool-use (~10%) —
birgermoell/oellm-eu-tooluse-v1: ~55k function-calling examples normalized to Qwen3.5-native format from Glaive-v2 / ToolACE / Hermes (all Apache-2.0).
Usage (with tools)
from transformers import AutoModelForCausalLM, AutoTokenizer # transformers >= 5.5 (qwen3_5 arch)
import torch
mid = "birgermoell/Qwen3.5-4B-EU-Tool"
tok = AutoTokenizer.from_pretrained(mid)
model = AutoModelForCausalLM.from_pretrained(mid, dtype=torch.bfloat16, device_map="auto")
tools = [{"type": "function", "function": {
"name": "get_weather",
"description": "Get the current weather for a city",
"parameters": {"type": "object",
"properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
msgs = [{"role": "user", "content": "Vad är vädret i Stockholm?"}]
ids = tok.apply_chat_template(msgs, tools=tools, add_generation_prompt=True,
return_tensors="pt").to(model.device)
print(tok.decode(model.generate(ids, max_new_tokens=200)[0, ids.shape[1]:], skip_special_tokens=True))
# -> <tool_call>\n{"name": "get_weather", "arguments": {"city": "Stockholm"}}\n</tool_call>
- No-think (default): fast, direct answers / tool calls.
- Thinking: add
/think(orenable_thinking=True) for step-by-step reasoning.
License
Apache-2.0 (inherits the Qwen3.5-4B base license). Built within OpenEuroLLM.
- Downloads last month
- 234
docker model run hf.co/birgermoell/Qwen3.5-4B-EU-Tool