syftr is an optimization framework designed to refine agent workflows under specific budget constraints. By providing a dataset and defining a search space of models and components, users can leverage syftr to sample that space efficiently. The tool employs advanced multi-objective Bayesian optimization and a specialized "Pareto pruner" to map the Pareto front—the optimal trade-off curve between accuracy and competing metrics such as cost, latency, and throughput.
Pareto-optimal search – syftr balances accuracy against secondary targets within a set budget, returning the most efficient workflow combinations.
Optional evaluation – Users can rigorously test generated workflows to validate real-world performance.
Versatile use cases – The tool supports foundation model tuning, synthetic exam generation, corpus processing, and various other agentic tasks.
syftr integrates several prominent open-source projects to power its functionality:
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv --python 3.12.7
source .venv/bin/activate
uv sync --extra dev
To use the full feature set, you will need:
api_url)Copy the config.yaml.sample file to config.yaml and update the relevant sections with your credentials.
config.yaml to define file paths, logging preferences, database connections, and Ray parameters. Refer to config.yaml.sample for specific examples before populating it with your infrastructure details.export SYFTR_PATHS__ROOT_DIR=/foo/bar.database.dsn field to point to a PostgreSQL instance or any other Optuna-supported relational database.After configuration is complete, you can verify the setup by running the examples/1-welcome.ipynb notebook.
make check to validate your configuration and credentials. Note that connection tests will fail if LLM credentials have not been configured.examples/ directory.from syftr import api
s = api.Study.from_file("studies/example-dr-docs.yaml")
s.run()
Retrieve the results once the study is complete:
s.wait_for_completion()
print(s.pareto_flows)
# [{'metrics': {'accuracy': 0.7, 'llm_cost_mean': 0.000258675},
# 'params': {'response_synthesizer_llm': 'gpt-4o-mini',
# 'rag_mode': 'no_rag',
# 'template_name': 'default',
# 'enforce_full_evaluation': True}},
# ...
# ]
In addition to built-in models, you can integrate any OpenAI-API-compatible endpoints via config.yaml.
Example: Generative model configuration
local_models:
default_api_key: "YOUR_API_KEY_HERE"
generative:
- model_name: "microsoft/Phi-4-multimodal-instruct"
api_base: "http://phi-4-host.com/openai/v1"
max_tokens: 2000
context_window: 129072
is_function_calling_model: true
additional_kwargs:
frequency_penalty: 1.0
temperature: 0.1
- model_name: "deepseek-ai/DeepSeek-R1-Distill-Llama-70B"
api_base: "http://big-vllm-host:8000/v1"
max_tokens: 2000
context_window: 129072
is_function_calling_model: true
additional_kwargs:
temperature: 0.6
Example: Embedding model configuration
local_models:
...
embedding:
- model_name: "BAAI/bge-small-en-v1.5"
api_base: "http://vllmhost:8001/v1"
api_key: "non-default-value"
additional_kwargs:
extra_body:
truncate_prompt_tokens: 512
- model_name: "thenlper/gte-large"
api_base: "http://vllmhost:8001/v1"
additional_kwargs:
extra_body:
truncate_prompt_tokens: 512
Models defined in the configuration file are automatically included in the default search space, or they can be manually assigned to specific workflow components.
MiMo-Audio: 100M-Hour Pretrained Model for Few-Shot Speech Tasks
O3Cloud: High-Speed Access to China for Overseas Users – 30-Day Free Trial
ZeroGraph TS: A 300-Line TypeScript Framework for AI Agent Coding
Google Analytics MCP Server: Query GA4 Data With Gemini CLI
Yazi: A High-Performance Terminal File Manager Built in Rust
Agents From Scratch: AI Email Assistant with Human-in-the-Loop Approval
Twenty CRM Local Setup and Docker Deployment Guide for Developers
Memvid: Store Millions of Text Chunks in a Single MP4 File
ConEmu: A Highly Customizable Windows Terminal with Tabs and Split Panes
ACI.dev: 600+ Tools for AI Agents with Built-In Auth and MCP Support
ALLinSSL: Automated SSL Certificate Lifecycle Management
Cnchar: A Lightweight JavaScript Library for Pinyin, Stroke Order & Idioms