532 lines
19 KiB
TOML
532 lines
19 KiB
TOML
[gateway]
|
|
debug = true
|
|
disable_pseudonymous_usage_analytics = true
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ MODELS │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[models."gpt-4o-mini-2024-07-18"]
|
|
routing = ["openai"]
|
|
|
|
[models."gpt-4o-mini-2024-07-18".providers.openai]
|
|
type = "openai"
|
|
model_name = "gpt-4o-mini-2024-07-18"
|
|
cost = [
|
|
{ pointer = "/usage/prompt_tokens", cost_per_million = 0.15, required = true },
|
|
{ pointer = "/usage/completion_tokens", cost_per_million = 0.60, required = true },
|
|
]
|
|
|
|
[models."llama-3.1-8b-instruct"]
|
|
routing = ["fireworks"]
|
|
|
|
[models."llama-3.1-8b-instruct".providers.fireworks]
|
|
type = "fireworks"
|
|
model_name = "accounts/fireworks/models/llama-v3p3-70b-instruct"
|
|
|
|
[embedding_models.text-embedding-3-small]
|
|
routing = ["openai"]
|
|
|
|
[embedding_models.text-embedding-3-small.providers.openai]
|
|
type = "openai"
|
|
model_name = "text-embedding-3-small"
|
|
|
|
[models."ft:gpt-4o-mini-2024-07-18:tensorzero::ALHEaw1j"]
|
|
routing = ["openai"]
|
|
|
|
[models."ft:gpt-4o-mini-2024-07-18:tensorzero::ALHEaw1j".providers.openai]
|
|
type = "openai"
|
|
model_name = "ft:gpt-4o-mini-2024-07-18:tensorzero::ALHEaw1j"
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ FUNCTIONS │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[functions.json_success_no_input_schema]
|
|
type = "json"
|
|
output_schema = "functions/json_success_no_input_schema/output_schema.json"
|
|
|
|
[functions.json_success_no_input_schema.experimentation]
|
|
type = "static"
|
|
candidate_variants = { "test" = 1.0 }
|
|
|
|
[functions.json_success_no_input_schema.variants.test]
|
|
type = "chat_completion"
|
|
model = "dummy::json"
|
|
max_tokens = 100
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.dummy_function]
|
|
type = "chat"
|
|
|
|
[functions.dummy_function.variants.dummy]
|
|
type = "chat_completion"
|
|
system_template = "functions/extract_entities/initial_prompt/system_template.minijinja"
|
|
model = "dummy::good"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.extract_entities]
|
|
type = "json"
|
|
output_schema = "functions/extract_entities/output_schema.json"
|
|
description = "Extract named entities from text"
|
|
|
|
[functions.extract_entities.variants.gpt4o_mini_initial_prompt]
|
|
type = "chat_completion"
|
|
model = "gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/extract_entities/initial_prompt/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 0
|
|
|
|
[functions.extract_entities.variants.gpt4o_initial_prompt]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o"
|
|
system_template = "functions/extract_entities/initial_prompt/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 0
|
|
|
|
[functions.extract_entities.variants.llama_8b_initial_prompt]
|
|
type = "chat_completion"
|
|
model = "llama-3.1-8b-instruct"
|
|
system_template = "functions/extract_entities/initial_prompt/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 0
|
|
|
|
[functions.extract_entities.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/extract_entities/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 0
|
|
|
|
[functions.extract_entities.variants.dicl]
|
|
type = "experimental_dynamic_in_context_learning"
|
|
embedding_model = "text-embedding-3-small"
|
|
model = "gpt-4o-mini-2024-07-18"
|
|
k = 10
|
|
max_distance = 0.5
|
|
system_instructions = "functions/extract_entities/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.extract_entities.variants.turbo]
|
|
type = "chat_completion"
|
|
model = "ft:gpt-4o-mini-2024-07-18:tensorzero::ALHEaw1j"
|
|
system_template = "functions/extract_entities/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 0
|
|
|
|
[functions.extract_entities.experimentation]
|
|
type = "adaptive"
|
|
metric = "jaro_winkler_similarity"
|
|
candidate_variants = [
|
|
"gpt4o_mini_initial_prompt",
|
|
"gpt4o_initial_prompt",
|
|
"llama_8b_initial_prompt",
|
|
]
|
|
fallback_variants = []
|
|
min_samples_per_variant = 10
|
|
delta = 0.05
|
|
epsilon = 0.1
|
|
update_period_s = 60
|
|
|
|
[functions.extract_entities.evaluators.exact_match]
|
|
type = "exact_match"
|
|
|
|
[functions.write_haiku]
|
|
type = "chat"
|
|
user_schema = "functions/write_haiku/user_schema.json"
|
|
description = "Generate a haiku about a given topic"
|
|
|
|
[functions.write_haiku.variants.dummy_slow]
|
|
type = "chat_completion"
|
|
model = "dummy::slow"
|
|
system_template = "functions/write_haiku/initial_prompt/system_template.minijinja"
|
|
user_template = "functions/write_haiku/initial_prompt/user_template.minijinja"
|
|
|
|
[functions.write_haiku.variants.initial_prompt_gpt4o_mini]
|
|
type = "chat_completion"
|
|
model = "gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/write_haiku/initial_prompt/system_template.minijinja"
|
|
user_template = "functions/write_haiku/initial_prompt/user_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.write_haiku.variants.initial_prompt_haiku_4_5]
|
|
type = "chat_completion"
|
|
model = "anthropic::claude-haiku-4-5"
|
|
system_template = "functions/write_haiku/initial_prompt/system_template.minijinja"
|
|
user_template = "functions/write_haiku/initial_prompt/user_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.write_haiku.variants.better_prompt_haiku_4_5]
|
|
type = "chat_completion"
|
|
model = "anthropic::claude-haiku-4-5"
|
|
system_template = "functions/write_haiku/better_prompt/system_template.minijinja"
|
|
user_template = "functions/write_haiku/better_prompt/user_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.generate_secret]
|
|
type = "json"
|
|
output_schema = "functions/generate_secret/output_schema.json"
|
|
|
|
[functions.generate_secret.experimentation]
|
|
type = "static"
|
|
candidate_variants = { "baseline" = 1.0 }
|
|
|
|
[functions.generate_secret.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/generate_secret/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
temperature = 1.5
|
|
|
|
[functions.ask_question]
|
|
type = "json"
|
|
output_schema = "functions/ask_question/output_schema.json"
|
|
system_schema = "functions/ask_question/system_schema.json"
|
|
|
|
[functions.ask_question.experimentation]
|
|
type = "static"
|
|
candidate_variants = { "baseline" = 1.0 }
|
|
|
|
[functions.ask_question.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/ask_question/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.ask_question.variants."gpt-4.1-nano"]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4.1-nano-2025-04-14"
|
|
system_template = "functions/ask_question/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.ask_question.variants."gpt-4.1-mini"]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4.1-mini-2025-04-14"
|
|
system_template = "functions/ask_question/baseline/system_template.minijinja"
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.answer_question]
|
|
type = "chat"
|
|
system_schema = "functions/answer_question/system_schema.json"
|
|
|
|
[functions.answer_question.experimentation]
|
|
type = "static"
|
|
candidate_variants = { "baseline" = 1.0 }
|
|
|
|
[functions.answer_question.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
system_template = "functions/answer_question/baseline/system_template.minijinja"
|
|
# for honesty
|
|
temperature = 0.5
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.unleash_kraken]
|
|
type = "chat"
|
|
|
|
[functions.unleash_kraken.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.image_judger]
|
|
type = "chat"
|
|
|
|
[functions.image_judger.variants.honest_answer]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.multi_hop_rag_agent]
|
|
type = "chat"
|
|
tools = ["think", "search_wikipedia", "load_wikipedia_page", "answer_question"]
|
|
tool_choice = "required"
|
|
parallel_tool_calls = false
|
|
|
|
[functions.multi_hop_rag_agent.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini"
|
|
system_template = "functions/multi_hop_rag_agent/baseline/system_template.txt"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.multi_hop_rag_agent.variants."gpt-4.1-mini"]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4.1-mini"
|
|
system_template = "functions/multi_hop_rag_agent/baseline/system_template.txt"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.multi_hop_rag_agent.variants."gemini-2.5-flash"]
|
|
type = "chat_completion"
|
|
model = "google_ai_studio_gemini::gemini-2.5-flash"
|
|
system_template = "functions/multi_hop_rag_agent/baseline/system_template.txt"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.multi_hop_rag_agent.variants."claude-haiku-4-5"]
|
|
type = "chat_completion"
|
|
model = "anthropic::claude-haiku-4-5"
|
|
system_template = "functions/multi_hop_rag_agent/baseline/system_template.txt"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.compact_context]
|
|
type = "chat"
|
|
system_schema = "functions/compact_context/system_schema.json"
|
|
|
|
[functions.compact_context.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini"
|
|
system_template = "functions/compact_context/baseline/system_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.compact_context.variants."gpt-4.1-nano"]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4.1-nano"
|
|
system_template = "functions/compact_context/baseline/system_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.compact_context.variants."gemini-2.5-flash"]
|
|
type = "chat_completion"
|
|
model = "google_ai_studio_gemini::gemini-2.5-flash"
|
|
system_template = "functions/compact_context/baseline/system_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[functions.judge_answer]
|
|
type = "json"
|
|
system_schema = "functions/judge_answer/system_schema.json"
|
|
user_schema = "functions/judge_answer/user_schema.json"
|
|
output_schema = "functions/judge_answer/output_schema.json"
|
|
|
|
[functions.judge_answer.variants."gpt-4.1-mini"]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4.1-mini"
|
|
system_template = "functions/judge_answer/gpt-4.1-mini/system_template.minijinja"
|
|
user_template = "functions/judge_answer/gpt-4.1-mini/user_template.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
json_mode = "strict"
|
|
|
|
[functions.custom_template_test]
|
|
type = "chat"
|
|
description = "Test function for custom-named templates and schemas"
|
|
schemas.greeting_template.path = "functions/custom_template_test/greeting_schema.json"
|
|
schemas.analysis_prompt.path = "functions/custom_template_test/analysis_schema.json"
|
|
schemas.fun_fact_topic.path = "functions/custom_template_test/fun_fact_schema.json"
|
|
|
|
[functions.custom_template_test.variants.baseline]
|
|
type = "chat_completion"
|
|
model = "gpt-4o-mini-2024-07-18"
|
|
templates.greeting_template.path = "functions/custom_template_test/baseline/greeting_template.minijinja"
|
|
templates.analysis_prompt.path = "functions/custom_template_test/baseline/analysis_prompt.minijinja"
|
|
templates.fun_fact_topic.path = "functions/custom_template_test/baseline/fun_fact_topic.minijinja"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ TOOLS │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[tools.think]
|
|
description = "Think about the question and the information you have gathered so far. This is a good time to plan your next steps."
|
|
parameters = "tools/think.json"
|
|
strict = true
|
|
|
|
[tools.search_wikipedia]
|
|
description = "Search Wikipedia for pages that match the query. Returns a list of page titles."
|
|
parameters = "tools/search_wikipedia.json"
|
|
strict = true
|
|
|
|
[tools.load_wikipedia_page]
|
|
description = "Load a Wikipedia page. Returns the page content, or an error if the page does not exist."
|
|
parameters = "tools/load_wikipedia_page.json"
|
|
strict = true
|
|
|
|
[tools.answer_question]
|
|
name = "submit_answer"
|
|
description = "End the search process and answer a question. Returns the answer to the question."
|
|
parameters = "tools/answer_question.json"
|
|
strict = true
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ METRICS │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[metrics.exact_match]
|
|
type = "boolean"
|
|
level = "inference"
|
|
optimize = "max"
|
|
|
|
[metrics.exact_match_episode]
|
|
type = "boolean"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.jaccard_similarity]
|
|
type = "float"
|
|
level = "inference"
|
|
optimize = "max"
|
|
|
|
[metrics.jaccard_similarity_episode]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.haiku_score]
|
|
type = "boolean"
|
|
level = "inference"
|
|
optimize = "max"
|
|
|
|
[metrics.haiku_score_episode]
|
|
type = "boolean"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.haiku_rating]
|
|
type = "float"
|
|
level = "inference"
|
|
optimize = "max"
|
|
|
|
[metrics.haiku_rating_episode]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.solved]
|
|
type = "boolean"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.num_questions]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "min"
|
|
|
|
[metrics.elapsed_ms]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "min"
|
|
|
|
[metrics.goated]
|
|
type = "boolean"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.judge_score]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "max"
|
|
|
|
[metrics.num_iterations]
|
|
type = "float"
|
|
level = "episode"
|
|
optimize = "min"
|
|
|
|
[metrics.jaro_winkler_similarity]
|
|
type = "float"
|
|
level = "inference"
|
|
optimize = "max"
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ EVALUATIONS │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[evaluations.entity_extraction]
|
|
type = "inference"
|
|
function_name = "extract_entities"
|
|
|
|
[evaluations.entity_extraction.evaluators.exact_match]
|
|
type = "exact_match"
|
|
|
|
[evaluations.entity_extraction.evaluators.count_sports]
|
|
type = "llm_judge"
|
|
output_type = "float"
|
|
optimize = "min"
|
|
include = { reference_output = false }
|
|
|
|
[evaluations.entity_extraction.evaluators.count_sports.variants.mini]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
active = true
|
|
system_instructions = "evaluations/entity_extraction/count_sports/system_instructions.txt"
|
|
json_mode = "strict"
|
|
temperature = 0.1
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[evaluations.haiku]
|
|
type = "inference"
|
|
function_name = "write_haiku"
|
|
|
|
[evaluations.haiku.evaluators.exact_match]
|
|
type = "exact_match"
|
|
|
|
[evaluations.haiku.evaluators.topic_starts_with_f]
|
|
type = "llm_judge"
|
|
output_type = "boolean"
|
|
optimize = "min"
|
|
include = { reference_output = false }
|
|
|
|
[evaluations.haiku.evaluators.topic_starts_with_f.variants.mini]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
active = true
|
|
system_instructions = "evaluations/haiku/topic_starts_with_f/system_instructions.txt"
|
|
json_mode = "strict"
|
|
temperature = 0
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[evaluations.images]
|
|
type = "inference"
|
|
function_name = "image_judger"
|
|
|
|
[evaluations.images.evaluators.exact_match]
|
|
type = "exact_match"
|
|
|
|
[evaluations.images.evaluators.honest_answer]
|
|
type = "llm_judge"
|
|
input_format = "messages"
|
|
output_type = "boolean"
|
|
optimize = "max"
|
|
include = { reference_output = false }
|
|
|
|
[evaluations.images.evaluators.honest_answer.variants.mini]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
system_instructions = "evaluations/images/honest_answer/system_instructions.txt"
|
|
temperature = 0
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
[evaluations.images.evaluators.matches_reference]
|
|
type = "llm_judge"
|
|
input_format = "messages"
|
|
output_type = "boolean"
|
|
optimize = "max"
|
|
include = { reference_output = true }
|
|
|
|
[evaluations.images.evaluators.matches_reference.variants.mini]
|
|
type = "chat_completion"
|
|
model = "openai::gpt-4o-mini-2024-07-18"
|
|
system_instructions = "evaluations/images/matches_reference/system_instructions.txt"
|
|
temperature = 0
|
|
json_mode = "strict"
|
|
retries = { num_retries = 4, max_delay_s = 10 }
|
|
|
|
# ┌────────────────────────────────────────────────────────────────────────────┐
|
|
# │ PROVIDER TYPES │
|
|
# └────────────────────────────────────────────────────────────────────────────┘
|
|
|
|
[provider_types.fireworks.sft]
|
|
account_id = "viraj-ebfe5a"
|
|
|
|
[provider_types.gcp_vertex_gemini.sft]
|
|
project_id = "tensorzero-public"
|
|
region = "us-central1"
|
|
bucket_name = "tensorzero-e2e-tests"
|