Skip to main content

Reliable tool-calling agents on local SLMs. Hybrid REWOO/ReAct architecture, MCP support, one-command export. No API keys, no cloud.

Project description

OnsetLab

Tool-calling AI agents that run locally.

License: Apache 2.0 Python 3.9+ PyPI Ollama

Quick Start · Architecture · MCP Servers · CLI · Models · Docs


Local models are fast, free, and private. But ask one to call a tool and it falls apart. Wrong function names, broken parameters, infinite loops.

The models are capable. The framework wasn't.

OnsetLab makes 3B-7B models do reliable tool calling through a hybrid REWOO/ReAct architecture. The framework handles planning, execution, and error recovery. The model only does what it's good at: one step at a time.


Quick Start

pip install onsetlab

Requires Ollama running locally with a model pulled:

ollama pull phi3.5
from onsetlab import Agent
from onsetlab.tools import Calculator, DateTime

agent = Agent("phi3.5", tools=[Calculator(), DateTime()])

result = agent.run("What's 15% tip on $84.50?")
print(result.answer)

The agent routes the query, builds an execution plan, calls the right tool, and returns the answer. No prompt engineering required.


Architecture

OnsetLab Architecture

The Router classifies queries as tool-needed or direct-answer using the model itself. The Planner generates structured THINK -> PLAN steps with auto-generated tool rules from JSON schemas. The Executor resolves dependencies and runs tools in order. If planning fails, the ReAct Fallback switches to iterative Thought -> Action -> Observation loops to recover.


Built-in Tools

Tool Description
Calculator Math expressions, percentages, sqrt/sin/log
DateTime Current time, timezones, date math, day of week
UnitConverter Length, weight, temperature, volume, speed, data
TextProcessor Word count, find/replace, case transforms, pattern extraction
RandomGenerator Random numbers, UUIDs, passwords, dice rolls, coin flips

More tools will be added over time.

MCP Servers

Connect any MCP-compatible server to give your agent access to external tools like GitHub, Slack, Notion, and more.

from onsetlab import Agent, MCPServer

server = MCPServer.from_registry("filesystem", extra_args=["/path/to/dir"])

agent = Agent("phi3.5")
agent.add_mcp_server(server)

result = agent.run("List all Python files in the directory")
print(result.answer)

agent.disconnect_mcp_servers()

Any MCP server available via npm works too. See the docs for examples.

Built-in registry: filesystem · github · slack · notion · google_calendar · tavily


CLI

python -m onsetlab                                          # interactive chat
python -m onsetlab --model qwen2.5:7b                       # specify model
python -m onsetlab benchmark --model phi3.5 --verbose        # validate a model
python -m onsetlab benchmark --compare phi3.5,qwen2.5:7b    # compare models
python -m onsetlab export --format docker -o ./my-agent      # export as Docker
python -m onsetlab export --format config -o agent.yaml      # export as YAML

Export formats: YAML (portable config), Docker (Dockerfile + compose + Ollama), vLLM (GPU-accelerated), Script (standalone .py file). See Export & Deploy docs for details.


Tested Models

Model Size RAM Notes
phi3.5 3.8B 4GB+ Default. Good balance of speed and quality
qwen2.5:3b 3B 4GB+ Fast, good for simple tasks
qwen2.5:7b 7B 8GB+ Strong tool calling
qwen3-a3b MoE, 3B active 16GB+ Best tool calling accuracy
llama3.2:3b 3B 4GB+ General purpose

Works with any Ollama model. Run python -m onsetlab benchmark --model your-model to verify.


Website · Playground · Documentation · PyPI

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

onsetlab-0.2.1.tar.gz (69.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

onsetlab-0.2.1-py3-none-any.whl (83.0 kB view details)

Uploaded Python 3

File details

Details for the file onsetlab-0.2.1.tar.gz.

File metadata

  • Download URL: onsetlab-0.2.1.tar.gz
  • Upload date:
  • Size: 69.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for onsetlab-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d983e7fa350c5e07df2d690ba40311b8b49d65517c90fce3d3637948c7631ce9
MD5 640d333b6c176e06d5659f14b2d1f749
BLAKE2b-256 57ad0cecf171709096b1ae714426ee7fd71cbb28fc3ddb6abc4195f6eade1479

See more details on using hashes here.

File details

Details for the file onsetlab-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: onsetlab-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 83.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for onsetlab-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1dbaced216e31fcd2f2ea5176893d8f7bd61722c9dcdc583eb9f9a37521cb8de
MD5 7693a11887d07021ab914fc5e9d4c780
BLAKE2b-256 7ea2b238db6f8a34a7562dc7659e292e9d3ebfdbe19c62160fd55c8cd2f44ffc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page