Instructions to use olo-labs/olo-qwen3-4b-thinking-hotfolder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use olo-labs/olo-qwen3-4b-thinking-hotfolder with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3-4B") model = PeftModel.from_pretrained(base_model, "olo-labs/olo-qwen3-4b-thinking-hotfolder") - Notebooks
- Google Colab
- Kaggle
olo-qwen3-4b-thinking-hotfolder
A QLORA adapter for Qwen/Qwen3-4B that calls olo-toolgate MCP tools. It was trained in the base model's own tool-calling format: give it the tools the standard way (the chat template's tools, or the tools field of an OpenAI-compatible server such as vLLM, Ollama or llama.cpp) and it answers with one tool call in that format, whose arguments match the tool's schema, or in plain text when no tool fits. Tools it was not trained on are offered the same way.
Results: base model vs this adapter
Same 254 held-out prompts (never seen in training), same system prompt, greedy decoding.
| Metric | Base model | This adapter | Change |
|---|---|---|---|
| Pass rate | 95.3% | 100.0% | +4.7 pts |
| Right tool | 97.3% | 100.0% | +2.7 pts |
| Strict JSON | 97.8% | 100.0% | +2.2 pts |
| Schema-valid arguments | 97.3% | 100.0% | +2.7 pts |
| Exact arguments | 87.9% | 100.0% | +12.1 pts |
| No-tool correct | 90.0% | 100.0% | +10.0 pts |
| Category | Base model | This adapter |
|---|---|---|
| defaults | 38/38 (100.0%) | 38/38 (100.0%) |
| negative | 16/18 (88.9%) | 18/18 (100.0%) |
| parameter_variation | 59/60 (98.3%) | 60/60 (100.0%) |
| positive | 118/126 (93.7%) | 126/126 (100.0%) |
| unavailable | 11/12 (91.7%) | 12/12 (100.0%) |
Training fixed 12 prompt(s) the base model failed and broke 0.
Validation prompts (written by the tool authors and by people, never trained on): 100.0% (37/37).
Training
| Base model | Qwen/Qwen3-4B |
| Method | QLORA |
| Tools | 10 |
| Training rows | 1447 |
| Steps | 400 |
| Final loss (avg of last 50 steps) | 0.0091 |
| Training time | 150.5 min |
| Run | 20261103_031800 |
Tools it was trained on: examples.hotfolder/append_text, examples.hotfolder/copy, examples.hotfolder/file_info, examples.hotfolder/hash, examples.hotfolder/list, examples.hotfolder/mkdir, examples.hotfolder/move, examples.hotfolder/read_text, examples.hotfolder/search_text, examples.hotfolder/write_text.
Use
import json
from peft import AutoPeftModelForCausalLM
from transformers import AutoTokenizer
from huggingface_hub import hf_hub_download
repo = "olo-labs/olo-qwen3-4b-thinking-hotfolder"
model = AutoPeftModelForCausalLM.from_pretrained(repo, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(repo)
# the tools it was trained on; add or replace with your own in the same shape
tools = [{"type": "function", "function": {"name": t["name"], "description": t["description"],
"parameters": t["parameters"]}}
for t in json.load(open(hf_hub_download(repo, "tools.json"), encoding="utf-8"))]
system = "You are an assistant connected to MCP tools through ToolGate. When one of the available tools can do what the user asks, call it: use the tool's exact name and only argument names from its schema, with the types, enum values and limits it allows; include every required argument and leave out optional ones the user did not ask for. If no available tool fits, answer in plain text without calling a tool."
messages = [{"role": "system", "content": system},
{"role": "user", "content": "Is host web-01 healthy?"}]
ids = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, return_tensors="pt", enable_thinking=False).to(model.device)
out = model.generate(ids, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(out[0][ids.shape[1]:], skip_special_tokens=False)) # the call in the model's format
With a server that parses tool calls (vLLM with the base model's tool parser, Ollama, llama.cpp), send the same system text and the tools in the request's tools field. tools.json is the tool list it was trained on. Built with olo-ai-training-mcp.
- Downloads last month
- 55