/ Модель

Характеристики

Контекст
8 192 токена
Параметры
134 млн
Размер весов
269 МБ
Лицензия
Apache 2.0
Архитектура
llama · dense
Базовая модель
SmolLM2-135M-Instruct
Опубликована
9 окт 2025

NanoAgent-135M

Генерация текстаТекст → текст4 профессии

Компактная англоязычная модель на базе SmolLM2 для диалогов, следования инструкциям и вызова инструментов в лёгких агентных сценариях.

237скачиваний за 30 дней24лайкавеса обновлены20 апр 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

NanoAgent — компактная языковая модель с 134,5 млн параметров, разработанная quwsarohi на базе HuggingFaceTB/SmolLM2-135M-Instruct. Это дообученная плотная модель семейства Llama для генерации текста, диалогов, следования инструкциям и лёгких агентных задач, включая вызов инструментов с JSON-аргументами и обработку полученных от инструментов сведений. Модель рассчитана на контекст до 8192 токенов и может работать на устройствах с ограниченными ресурсами; в README отдельно описан запуск на CPU и через MLX.

Модель дообучена методом supervised fine-tuning на наборах данных для следования инструкциям, математических задач, диалогов и вызова функций. В опубликованных оценках она превосходит базовую модель по нескольким тестам следования инструкциям, но точность BFCL для вызова инструментов составляет 28,99%, поэтому результаты работы агента следует проверять. Модель ориентирована на английский язык. Репозиторий распространяется по лицензии Apache 2.0; для обучающих данных сохраняются отдельные условия лицензий исходных наборов.

Сценарии применения

  • вызов функций и инструментов с JSON-аргументами
  • ответы на вопросы по результатам веб-поиска и извлечённым данным
  • создание лёгкого диалогового помощника на CPU или edge-устройстве
  • выполнение инструкций и выдача структурированных ответов
  • решение простых математических задач с пошаговым рассуждением

Ограничения

Вызов инструментов оценивается умеренно: точность BFCL в README составляет 28,99%, поэтому корректность вызовов и итоговых ответов требует проверки. Модель компактная и англоязычная; результаты на других языках и сложных задачах в предоставленных данных не описаны.

Для каких профессий подходит4

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

🧠 NanoAgent — A 135M Parameter Agentic SLM

NanoAgent is a 135M parameter, 8k context length, open-source language model designed for agentic tasks such as tool calling, instruction following, and lightweight reasoning.
It’s small enough (~135 MB in 8-bit) to run on edge devices like personal laptops, low-memory CPUs, and even wearables — yet smart enough to make tool calls, parse web information, and give structured answers.

Quick inference resource: here

Github Scripts: NanoAgent-135M

Run in Ollama: ollama run quwsarohi/NanoAgent

🌍 Real-World Use Cases

  • 🕹️ Runs on edge devices — laptops, smartwatches, browsers, or CPU-only environments.
  • 🌐 Parses and answers from the web — supports tool calling to fetch real-time information.
  • 🔎 Answers recent questions with live web search tools.
  • 💬 Continues conversations — ideal for assistant or agent frameworks.
  • ⚙️ Tool calling support enables chaining multiple tools and parsing results to produce final answers.

✨ What NanoAgent Supports

CapabilityDescription
💬 Basic conversationCasual small talk
🌐 Information retrievale.g., “How to bake a cake?”, “Weather in Toronto” through web search. Extracts answers from information returned by tools (scraping/search)
🧰 Tool callingSingle & multi-tool call with structured explanation
🧠 Question decompositionBreaks complex questions into steps
🧭 Question classificationIdentifies type of user query (e.g., fact, reasoning, instruction)
📝 Following system promptsResponds properly to system-level instructions
✍️ Writing emails and tasksWrites emails, structured messages

🧪 Training Overview

📚 Datasets Used

This model was trained using a combination of datasets under different open licenses.
Each dataset retains its original license, and use of those datasets is subject to their respective terms.

General Training (SFT)

DatasetPurposeLicense
microsoft/orca-math-word-problems-200kMath reasoning, word-level reasoningMIT
allenai/tulu-3-sft-personas-instruction-followingInstruction following with personasOpen Data Commons License Attribution
mlabonne/orca-agentinstruct-1M-v1-cleanedRAG, MCQ, JSON parsing, text classificationCommunity Data License Agreement – Permissive, Version 2.0
HuggingFaceTB/smoltalk (systemchats-30k)General conversation, system promptsApache-2.0
HuggingFaceTB/smoltalk (everyday-conversations)Everyday conversationApache-2.0
nvidia/Nemotron-Instruction-Following-Chat-v1Instruction following, structured outputsNVIDIA Open Model License

Function Calling Training

DatasetPurposeLicense
Locutusque/function-calling-chatmlTool call response formattingApache-2.0
Salesforce/xlam-function-calling-60kFunction calling coverageCreative Commons Attribution 4.0
nemotron/interactive_agent (local)Tool calling, agentic behaviorNVIDIA Open Model License

🧭 Key Explorations & Findings

  • ✂️ Dataset deduplication significantly improved performance by removing noisy or duplicate Q/As.
  • ✂️ Shortening the responses (casual response) and using shorter python code in training improved performance and reduce repeated token generation.
  • 🧮 Word-level reasoning from orca-math enhanced the model’s ability to handle stepwise logic.
  • 🧰 Designing tool calling prompts using six open-source tool calling datasets resulted in stronger structured output generation.
  • 🌐 Tool calling integration enabled the model to extract answers from parsed web data, supporting up-to-date queries.

⚡ Benchmark

Model Comparison

BenchmarkSmolLM2-135M-InstructNanoAgent
Commonsense QA (acc)20.88%20.23%
IFEval (prompt strict)21.63%29.94%
IFEval (inst strict)35.01%42.33%
IFEval (prompt loose)23.84%32.16%
IFEval (inst loose)37.65%45.32%
tinyArc (acc_norm)33.76%36.47%
tinyGSM8k (exact_match)0.55%2.31%
tinyHellaswag (acc_norm)42.20%43.45%
tinyMMLU (acc_norm)26.79%27.62%
tinyTruthfulQA (acc)38.65%40.45%
tinyWinogrande (acc_norm)46.48%42.86%

BFCL Benchmark (Tool Calling)

CategoryAccuracyCorrect/Total
Overall28.99%725/2501
parallel56.50%113/200
parallel_multiple54.50%109/200
simple_python41.50%166/400
simple_javascript40.00%20/50
multiple31.50%63/200
live_simple28.29%73/258
simple_java27.00%27/100
live_parallel37.50%6/16
live_parallel_multiple25.00%6/24
live_multiple13.49%142/1053

*All evaluations were conducted using greedy decoding (sampling parameter was set to false during HuggingFace inference).

Key Findings

  • NanoAgent significantly outperforms the base SmolLM2-135M-Instruct on instruction following (IFEval) with +8-10% improvements across all metrics
  • NanoAgent improves on tinyMMLU, tinyTruthfulQA, and tinyHellaswag over the base model
  • 🧰 Tool Calling: Only NanoAgent supports tool calling — SmolLM2-135M-Instruct does not

⚡ Example Usage

Basic Inference

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "quwsarohi/NanoAgent-135M"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")

def inference(messages, max_new_tokens=256, temperature=0.3, **kwargs):
    if isinstance(message, list):
        input_text = tokenizer.apply_chat_template(
            messages, tokenize=False, add_generation_prompt=True
        )
    inputs = tokenizer.encode(input_text, return_tensors="pt").to(model.device)
    outputs = model.generate(
        inputs,
        max_new_tokens=max_new_tokens,
        do_sample=True,
        temperature=temperature,
        **kwargs
    )
    return tokenizer.decode(outputs[0][inputs.shape[1]:], skip_special_tokens=True)

messages = [{"role": "user", "content": "Hi! Do you have a name?"}]
print(inference(messages))

Tool Calling

NanoAgent uses a JSON-based tool calling format:

import json

tools = [
    {
        "type": "function",
        "function": {
            "name": "web_search",
            "description": "Performs a web search and returns formatted results.",
            "parameters": {
                "type": "object",
                "properties": {
                    "query": {"type": "string", "description": "The search query."}
                },
                "required": ["query"],
            },
        }
    }
]

TOOL_TEMPLATE = """You are a helpful AI assistant. You have a set of possible tools that you can execute to retrieve information or to perform specific actions. You can execute zero or more tools to answer user question.

Here are the list of tools that you have access to:
```json
{tools}
```

Only execute tools from above. Follow the below JSON signature to execute tools:
```json
[{{"name": "tool_name", "arguments": {{"arg1": "val1", ...}}}}, ...]
```
"""

messages = [
    {"role": "system", "content": TOOL_TEMPLATE.format(tools=json.dumps(tools, indent=2))},
    {"role": "user", "content": "What's the latest AI news?"},
]
response = inference(messages, max_new_tokens=512)
print(response)

# Output: ```json
# [{"name": "web_search", "arguments": {"query": "latest AI news 2026"}}]
# ```

It is suggested to add '''json\n tokens as prefill during inference. This shows improved performance as LLM knows it has to execute a tool.

messages = [
    {"role": "system", "content": TOOL_TEMPLATE.format(tools=json.dumps(tools, indent=2))},
    {"role": "user", "content": "What's the latest AI news?"},
    {"role": "assistant", "content": "```json\n"}
]

input_text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=False,
    continue_final_message=True
)

response = inference(input_text, max_new_tokens=512)
print(response)

# Output: [{"name": "web_search", "arguments": {"query": "latest AI news 2026"}}]
# ```

🧭 Roadmap

  • 📊 Benchmark more agentic tasks
  • 🧠 Explore GRPO for tool calling improvement
  • 🔀 Experiment with weight merging
  • 🧪 Evaluate multi-turn tool chaining
  • 🧹 Further refine datasets for stability

📄 License

This project (code, model weights, and training recipes) is licensed under the Apache License 2.0.

📢 Notice

  • Model & code are © quwsarohi, licensed under Apache 2.0.
  • Portions of the training data were sourced from third-party datasets under CDLA-P 2.0, MIT, CC-BY 4.0, ODC-BY, and Apache 2.0.
  • The licensors of these datasets do not endorse this project or its outputs.
  • If you redistribute or fine-tune this model, ensure your use complies with all applicable dataset licenses.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

MLX-модели работают только на Apple Silicon.

Класс архитектуры
LlamaForCausalLM
Ревизия весов
cb9214a

0 моделей