← Lab
Field note·Local LLM, GPU & Inference·5 min read

From $18K to $2.1K/Month on a Multi-Agent System

When every agent calls an external API, the bill has no ceiling. Bringing the model inside is the fix — but a base model alone will not do it.

From $18K to $2.1K/Month on a Multi-Agent System

A multi-agent system where each agent hits a hosted API grows in cost with every user and every step, and nothing in the architecture caps it. Moving inference in-house is the obvious answer, and the obvious answer is where most attempts stall.

Why self-hosting alone fails

The instinct is to swap the API for an open-weights model and stop. But base models know how to talk, not how to use your tools. They generate fluent text and struggle with exactly the things an agent needs.

A base model can
  • Generate fluent text
  • Answer questions
  • Summarise content
A base model struggles with
  • Knowing when to call a function
  • Building correct parameters
  • Chaining several calls
  • Knowing when the task is done

Build the function-calling dataset

No dataset exists for your specific tools, so you have to create it. Each sample needs the user query, the full schema of available tools, the correct call, and — the part most people skip — the decision that the task is finished. Production traffic is the best source: real queries carry the edge cases you would never invent.

The staged path, and what each stage is worth

01Self-host + fine-tuneThe largest single reduction. A tuned open model can match a frontier model on your narrow task while removing per-token pricing.
02Route by difficultySimple intents never reach a frontier model; only genuine multi-step reasoning escalates.
03Cache semanticallyUsers ask the same thing in different words. Exact-match caching catches almost none of it.

Applied together, this approach can take a multi-agent bill from around $18K a month to roughly $2.1K — an 88% reduction — without giving up capability. The order matters: fine-tuning is what makes the other two possible, because routing and caching are only safe once the local model is good enough to trust with the traffic they send it.

What to take away
  • A base model can talk but cannot use your tools — fine-tune for function calling.
  • Build the dataset from production traffic; it carries the edge cases.
  • Include the stopping decision in training data, not just the calls.
  • Fine-tune first, then route by difficulty, then cache semantically.

Field notes on building production AI systems — collected, verified and written up so they are useful to anyone working on the same problems.

smoke
“Innovation distinguishes between a leader and a follower.”

Need an AI system that holds up in production? Tell me what breaks today and I'll tell you what I'd build.

Call Me now !

mail

abdelmajidzaddi088@gmail.com

address

Mohammedia, Morocco

phone

+212 695 557 631