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.
Tencent HunyuanVideo-1.5: 8.3B Video Model Runs on 14GB GPUs
withoutbg: Free Local & API-Based AI Background Removal Tool
AI Presentation Generator: An Open-Source Gamma Alternative for Slide Decks
Shendeng VPN Review: High-Speed Gaming, Video Streaming, and Unlimited Data
Perplexica: The Open-Source AI Search Engine Powered by Your Own LLMs
Alger Music Player: Play Grayed-Out NetEase Songs with Desktop Lyrics
Build AI Agent Interfaces Faster with agents-ui-kit
Crawl4AI: Fast LLM-Ready Web Scraping Without the Bloat
TensorZero: Optimize LLM Applications with Production Feedback
Slidev: Markdown-Based Presentations for Developers
Xiaomi MiMo-7B: Built From Scratch for Math and Code Reasoning
Dragon Ball RPG “Peak of Power” Review: Best Teams, Goku Skills, and F2P Guide