Token-efficient multi-agent pipeline optimization
Project description
brevitas-systems
Token-efficient multi-agent pipeline optimization.
pip install brevitas-systems
from brevitas import optimize
from my_pipeline import architect, builder, reviewer
pipeline = optimize([architect, builder, reviewer])
result = pipeline.run(task)
# ↳ 59% fewer tokens. 47% lower cost. 99% quality parity.
Setup
Generate an API key at brevitas.systems/dashboard, then either:
export BREVITAS_API_KEY=bvt_your_key_here
or pass it directly:
from brevitas import optimize, configure
configure(api_key="bvt_your_key_here")
pipeline = optimize([architect, builder, reviewer])
How it works
Brevitas wraps your existing agent pipeline and applies five complementary token-reduction tactics on every turn:
| Tactic | What it does |
|---|---|
| Task-aware routing | Sends each task to the smallest model that can handle it |
| Smart context pruning | Drops low-relevance context before it hits the prompt |
| Adaptive semantic sampling | Scores context chunks by relevance, recency, and novelty |
| Communication compression | Strips redundancy from inter-agent messages |
| Shared memory + delta payloads | Sends only what changed since the last turn |
API reference
optimize(agents, *, api_key=None, **kwargs) → OptimizedPipeline
Wrap a list of agents in the Brevitas optimization layer.
| Param | Type | Default | Description |
|---|---|---|---|
agents |
list |
required | Agent callables. Each receives the previous agent's output. |
api_key |
str |
env var | Your bvt_ prefixed API key. |
quality_floor |
float |
0.98 |
Min quality proxy before the pipeline stops compressing. |
savings_target |
float |
59.0 |
Token savings % to target per turn. |
compression_level |
int |
2 |
Message compression aggressiveness (1–3). |
prune_budget |
int |
5 |
Max context items retained per turn. |
OptimizedPipeline.run(task, **kwargs) → PipelineResult
Run a task through the pipeline. Returns a PipelineResult with:
savings_pct— tokens saved vs. unoptimized baselinemodel_response— concatenated agent outputsbaseline_tokens/optimized_tokens— raw countsquality_proxy— estimated quality retention (0–1)debug— internal metrics (compression, sampling, pruning)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
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 brevitas_systems-0.1.0-py3-none-any.whl.
File metadata
- Download URL: brevitas_systems-0.1.0-py3-none-any.whl
- Upload date:
- Size: 78.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49f5fc7d575aaeba830e07414fc2f7d07624e280f7af75ee8b0e23fc919fc150
|
|
| MD5 |
9e634d5518d962fd6e99af6cfe552de9
|
|
| BLAKE2b-256 |
f6b8150ebdaa30d40fa710eedbedbeca39017989bba19ed5544d926c3af45455
|