slom
SLOM — Small Language Orchestration Machine. Tool-using agents for 0.5–3B models as durable workflows: every model and tool call is journaled to SQLite, so a crashed worker's runs resume elsewhere without repeating finished calls. No orchestration server, just a package and a file.
GitHub · Full README · Architecture · Benchmarks · Changelog
Install
pip install slom
SLOM needs an OpenAI-compatible /v1/completions server. It's built and tested against
slim-serve:
pip install "slim-serve[llama]" --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
slim-serve serve --model qwen2.5-0.5b-instruct-q4_k_m.gguf # :8000
Quick start
slom run "A crate holds 48 bottles. How many bottles are in 26 crates?" --protocol qwen
slom serve # HTTP API + worker on :8080
curl -s 'localhost:8080/v1/runs?wait=true' -H 'content-type: application/json' \
-d '{"question": "A crate holds 48 bottles. How many bottles are in 26 crates?", "protocol": "qwen"}'
Your own tools
A tool is a function plus a pydantic argument model. Errors you raise as ToolError go back to the
model; idempotency_key() stays stable across retries and crash recovery.
import asyncio
from pydantic import BaseModel
from slom import BUILTIN_TOOLS, ToolError, idempotency_key, tool
from slom.config import Settings
from slom.worker import serve_worker
class RefundArgs(BaseModel):
order_id: str
amount: float
@tool(description="Refund an order. Returns the refund ID.")
async def refund(args: RefundArgs) -> str:
if args.amount <= 0:
raise ToolError("amount must be positive")
return await payments.refund(args.order_id, args.amount, idempotency_key=idempotency_key())
asyncio.run(serve_worker(Settings(), tools=[*BUILTIN_TOOLS, refund]))
Your own workflows
The engine isn't agent-specific. Each ctx.step is journaled, so finished steps aren't repeated
after a crash:
from slom import RunContext, Store, Worker, Workflow
async def pipeline(ctx: RunContext, doc_id: str) -> str:
text = await ctx.step("fetch", fetch_document, doc_id)
summary = await ctx.step("summarize", summarize, text)
return await ctx.step("store", save_summary, summary)
worker = Worker(Store("slom.db"), [Workflow.define("pipeline", pipeline)])
Measured
- Task success: with Qwen2.5-0.5B on 42 arithmetic word problems, the agent got 62% right, against 38% for a chain-of-thought baseline (p = 0.03).
- Crash recovery: workers hard-killed mid-run, 20 trials: every run completed, no finished step was lost.
- Durability cost: about 3 ms per journaled step with full
fsync, well under 1% of a model call.
Methodology, caveats and raw data
Configuration
SLOM_* environment variables, a .env file, or CLI flags (which take precedence):
| Variable | Default | Meaning |
|---|---|---|
SLOM_LLM_BASE_URL |
http://127.0.0.1:8000 |
slim-serve or another OpenAI-compatible server |
SLOM_LLM_CONCURRENCY |
1 |
Model calls in flight per worker; match the server's replicas |
SLOM_DB_PATH |
slom.db |
SQLite journal, shared by the API and workers on one host |
SLOM_MAX_CONCURRENT_RUNS |
8 |
Runs one worker executes at once |
SLOM_LEASE_S |
15 |
How soon a crashed worker's runs move elsewhere |
SLOM_API_HOST, SLOM_API_PORT |
127.0.0.1, 8080 |
API bind address |
Learn more
- Failure handling and metrics
- Design decisions: why not Temporal, why SQLite, leases and fencing
- Limitations and the 10x plan
MIT licensed.
Metadata
Release files for slom 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| slom-0.1.1.tar.gz | 145.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| slom-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 184.0 kB
Release files / slom-0.1.1.tar.gz
| Download URL | slom-0.1.1.tar.gz |
|---|---|
| Size | 145.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d20cc5311009a4e316b89e8857534bdb22c1e81eee8de65f1205bc7b4298a0f7
|
|
BLAKE2b-256 checksum How to use checksums |
e4c5b0ae82279f43be3079b68236edf62c2ef37c25a15551b76d1d1284c672eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.24
|
Release files / slom-0.1.1-py3-none-any.whl
| Download URL | slom-0.1.1-py3-none-any.whl |
|---|---|
| Size | 38.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3673daf378012391e503ccf8dd59832c538a1f23764b8e70b380f9349d67535f
|
|
BLAKE2b-256 checksum How to use checksums |
2889ca0daafebc03d23c8d9af97a54ffdbca8601c00816def40652134c029f63
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.24
|