Build, benchmark, and package local SLM agents. No API keys, no cloud.
Project description
OnsetLab
Make your local SLMs do actual work.
What
Agent framework for small language models (3B parameters) that achieves GPT-4 level tool use on your laptop. Uses REWOO architecture (plan → execute → verify) with ReAct fallback for robustness.
- No API keys - runs entirely on Ollama
- No fine-tuning - works out of the box with any Ollama model
- MCP support - connect to any MCP-compatible server
- Package & Deploy - export as Docker, config, or standalone script
Install
pip install onsetlab
Requires Ollama running locally.
Quick Start
from onsetlab import Agent
agent = Agent("phi3.5")
result = agent.run("What time is it in Tokyo?")
print(result.answer)
Adding Tools
Choose only the tools you need:
from onsetlab import Agent
from onsetlab.tools import Calculator, DateTime, UnitConverter, TextProcessor, RandomGenerator
agent = Agent(
model="phi3.5",
tools=[Calculator(), DateTime()]
)
result = agent.run("What's 15% tip on $84.50?")
print(result.answer) # "The 15% tip on $84.50 is $12.68"
Available built-in tools:
Calculator- math operationsDateTime- current time, timezones, date mathUnitConverter- convert between unitsTextProcessor- word count, search, transform textRandomGenerator- random numbers, strings, choices
MCP Servers
Connect to external services via Model Context Protocol:
from onsetlab import Agent, MCPServer
agent = Agent("phi3.5")
# Add filesystem access
agent.add_mcp_server(MCPServer.from_registry("filesystem", path="/my/project"))
# Add GitHub integration
agent.add_mcp_server(MCPServer.from_registry("github", token="ghp_..."))
result = agent.run("List all Python files in the project")
print(result.answer)
Registry servers: filesystem, github, slack, notion, google_calendar, tavily
Or configure any MCP server manually:
server = MCPServer(
name="my-server",
command="npx",
args=["-y", "@some/mcp-server"],
env={"API_KEY": "..."}
)
agent.add_mcp_server(server)
Packaging & Deployment
Export your agent for deployment:
# Export as Docker (includes docker-compose with Ollama)
agent.export("docker", "./my_agent/")
# Export as config file
agent.export("config", "my_agent.yaml")
# Export as standalone script
agent.export("binary", "my_agent.py")
Or via CLI:
python -m onsetlab export --format docker --output ./deployment/
cd deployment && docker-compose up --build
See docs/PACKAGING.md for full deployment guide.
Benchmarking
Compare model performance on tool-calling:
# Benchmark single model
python -m onsetlab benchmark --model phi3.5
# Compare models
python -m onsetlab benchmark --compare "phi3.5,qwen2.5:3b,llama3.2:3b"
See specs/BENCHMARKING.md for methodology.
Architecture
Task → Router → Strategy Selection
↓
┌─────────┼─────────┐
↓ ↓ ↓
DIRECT REWOO REACT
↓ ↓ ↓
└─────────┘
↓
Verifier → Solver → Answer
- Router - selects optimal strategy (DIRECT/REWOO/REACT)
- Planner - creates step-by-step execution plan (REWOO)
- Verifier - validates plan before execution
- Executor - runs tools with dependency resolution
- Solver - synthesizes final answer from results
- ReAct fallback - recovers from planning failures
Options
agent = Agent(
model="phi3.5", # any Ollama model
tools=[...], # built-in tools
mcp_servers=[...], # MCP servers
memory=True, # conversation memory
verify=True, # pre-execution verification
routing=True, # intelligent strategy selection
react_fallback=True, # fallback on REWOO failure
debug=False # verbose logging
)
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file onsetlab-0.1.0.tar.gz.
File metadata
- Download URL: onsetlab-0.1.0.tar.gz
- Upload date:
- Size: 83.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56cda012708a3f0f6c443ff25749b1ae37e61b16ca4aa15ae014d78c8472628e
|
|
| MD5 |
b65d171dfbc2afa85ef416c077a3039f
|
|
| BLAKE2b-256 |
b4726675bf323fd1743bd2e5310cb248831b4ac60b53f405868ad4b87312cd29
|
File details
Details for the file onsetlab-0.1.0-py3-none-any.whl.
File metadata
- Download URL: onsetlab-0.1.0-py3-none-any.whl
- Upload date:
- Size: 87.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52548ddfdb9acc254b501f11b2008e4b2fffddbe530bbdc66345874c93a5eff6
|
|
| MD5 |
7c85e08ee2cfb06ad01585445977e74d
|
|
| BLAKE2b-256 |
656184007015a8033f34467ec86f71b94f0d63fcda70a1de95d8d508939fbbe9
|