Downloads · 30 days
186
100% of all-time downloads
oopere/qwen3-0.6b-weather-geo-specialist
qwen3-0.6b-weather-geo-specialist is a machine learning model from oopere. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
This model is a LoRA fine-tuned specialist for weather and geolocation tool calling, built with the techniques covered in Chapter 13 of the book "Rearchitecting LLMs". It is the first member of a small model family bu…
Downloads · 30 days
186
100% of all-time downloads
All-time downloads
186
Public
Parameters
596M
7.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1.2 GB · 99%
From the Hugging Face model README
This model is a LoRA fine-tuned specialist for weather and geolocation tool calling, built with the techniques covered in Chapter 13 of the book "Rearchitecting LLMs". It is the first member of a small model family built for that chapter, where a general-purpose frontier model API call is replaced by a compact, task-specific model for a narrow, well-defined use case.
Within the chapter, this model acts as the teacher for the subsequent pruning and knowledge-distillation stage that produces a smaller student model with (near-)equivalent tool-calling accuracy.
The model was fine-tuned to reliably select the correct function and arguments among three tools: get_ip_zipcode, get_city_from_zipcode, and local_weather_api. Evaluation uses an exact-match metric and a tolerant-match metric that accounts for functionally equivalent values (superset city names, coordinates within 0.05°).
| Metric | Base Model | Fine-Tuned Specialist |
|---|---|---|
| Valid JSON | 100.0% | 100.0% |
| Exact Match | 88.9% | 96.3% |
| Tolerant Match | 88.9% | 96.3% |
| Right function, wrong args | 6 | 2 |
| Wrong function selected | 0 | 0 |
| No tool_call emitted | 0 | 0 |
| Metric | Value |
|---|---|
| Exact Match | 98.3% |
| Tolerant Match | 98.3% |
Train and test accuracy are close (98.3% vs. 96.3%), suggesting the model generalizes the tool-calling pattern rather than memorizing the small training set.
Note on remaining errors: Of the 2 wrong-argument cases on the test set, one involves an IP address the model was not trained to resolve correctly, and the other omits an optional
num_of_daysargument not always implied by the query. Both are argument-extraction edge cases, not function-selection failures.
Qwen/Qwen3-0.6Bq_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projget_ip_zipcode, get_city_from_zipcode, local_weather_api), then deduplicated by normalized query textfrom transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "oopere/qwen3-0.6b-weather-geo-specialist"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
messages = [{"role": "user", "content": "What's the weather in Barcelona?"}]
tools = [...] # weather/geo tool schemas — see the book's companion notebook
prompt = tokenizer.apply_chat_template(
messages, tools=tools, tokenize=False, add_generation_prompt=True, enable_thinking=False,
)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200, do_sample=False)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
This is an educational model created as part of the Hands-on Lab in Chapter 13 of "Rearchitecting LLMs". It illustrates:
Not intended for production use. This model serves as a learning artifact within a three-function toy domain, and as a baseline for readers to compare against the distilled student model.
get_ip_zipcode, get_city_from_zipcode, local_weather_api); no general-purpose tool-calling capability was evaluatedIf you use this model or the techniques described in your research or projects, please cite:
@book{martra2026rearchitecting,
author = {Pere Martra},
title = {Rearchitecting LLMs: Structural techniques for efficient models},
publisher = {Manning Publications},
year = {2026},
url = {https://hubs.la/Q040tvtp0}
}
@software{optipfair2024,
author = {Pere Martra},
title = {OptiPFair: Structural Pruning and Bias Analysis for LLMs},
year = {2024},
url = {https://github.com/peremartra/optipfair}
}
This model was created following the methodologies taught in "Rearchitecting LLMs" (Manning Publications, 2026). Special thanks to the Manning editorial team and the open-source community behind Hugging Face Transformers, PEFT, TRL, and PyTorch.