Use this file to discover all available pages before exploring further.
Multi-target baking lets you bake entire knowledge bases worth of prompts into a single model. Each piece of knowledge (a document, fact, procedure) becomes a target, and you control how much each piece influences the final model through weighted datasets.
Completed your first bake? Multi-target baking builds on that foundation.
Traditional RAG systems store product information in a vector database, retrieve relevant docs at runtime, and inject them into prompts. Multi-target baking bakes the knowledge directly into weights.
Imagine you’re building an Apple support chatbot. Your knowledge base contains:Document 1: iPhone Support
iPhone Troubleshooting:- iPhone won't turn on: Hold Side + Volume Down for 10 seconds- Battery drains quickly: In Settings, disable background refresh- Can't connect to WiFi: Reset network settings in General → Reset
Document 2: Mac Support
Mac Troubleshooting:- Mac won't start: Press and hold power button for 10 seconds- Running slow: Check Activity Monitor for memory usage & clear cache- Bluetooth issues: Turn Bluetooth off/on, remove and re-pair device
Document 3: AirPods Support
AirPods Troubleshooting:- Won't connect: Put in case, hold button on back for 15 seconds- Audio cutting out: Clean AirPods speakers, check Bluetooth connection- Battery drains fast: Disable automatic ear detection in Bluetooth settings
Instead of RAG retrieval, bake each support document as a separate target.
Set up your repository and the shared empty student prompt:
from aibread import Breadclient = Bread()# Create repositoryclient.repo.set(repo_name="apple_support_agent")# Shared student prompt (empty for always-on)client.prompts.set( prompt_name="empty_student_prompt", repo_name="apple_support_agent", messages=[{"role": "system", "content": ""}])
In this example, we use a shared empty student prompt since we wish that this model always responds as an Apple customer support agent.
2
Create iPhone Support Target
Bake iPhone troubleshooting knowledge:
# iPhone Support Knowledgeclient.prompts.set( prompt_name="iphone_teacher_prompt", repo_name="apple_support_agent", messages=[{ "role": "system", "content": """ You are an Apple iPhone support expert. You know: iPhone Troubleshooting: - iPhone won't turn on: Hold Side + Volume Down for 10 seconds - Battery drains quickly: In Settings, disable background refresh - Can't connect to WiFi: Reset network settings in General → Reset """ }])client.targets.set( target_name="iphone_support", repo_name="apple_support_agent", template="default", overrides={ "generators": [ { "type": "hardcoded", "numq": 3, "questions": [ "My iPhone won't turn on", "Why is my iPhone battery draining so fast?", "My iPhone screen is frozen" ] }, { "type": "oneshot_qs", # LLM-generated stim prompts "numq": 100, "model": "claude-sonnet-4-5-20250929", "temperature": 0.6 } ], "teacher_prompt": "iphone_teacher_prompt", "student_prompt": "empty_student_prompt" })# Generate stim dataclient.targets.stim.run( target_name="iphone_support", repo_name="apple_support_agent")# Once stim complete, generate rollout dataclient.targets.rollout.run( target_name="iphone_support", repo_name="apple_support_agent")
3
Create Mac Support Target
Bake Mac troubleshooting knowledge:
# Mac Support Knowledgeclient.prompts.set( prompt_name="mac_teacher_prompt", repo_name="apple_support_agent", messages=[{ "role": "system", "content": """ You are an Apple Mac support expert. You know: Mac Troubleshooting: - Mac won't start: Press and hold power button for 10 seconds - Running slow: Check Activity Monitor for memory usage & clear cache - Bluetooth issues: Turn Bluetooth off/on, remove and re-pair device """ }])client.targets.set( target_name="mac_support", repo_name="apple_support_agent", template="default", overrides={ "generators": [ { "type": "hardcoded", "numq": 3, "questions": [ "My Mac won't start up", "Why is my Mac running so slow?", "My Mac app keeps crashing" ] }, { "type": "oneshot_qs", # LLM-generated stim prompts "numq": 100, "model": "claude-sonnet-4-5-20250929", "temperature": 0.6 } ], "teacher_prompt": "mac_teacher_prompt", "student_prompt": "empty_student_prompt" })client.targets.stim.run( target_name="mac_support", repo_name="apple_support_agent")client.targets.rollout.run( target_name="mac_support", repo_name="apple_support_agent")
4
Create AirPods Support Target
Bake AirPods troubleshooting knowledge:
# AirPods Support Knowledgeclient.prompts.set( prompt_name="airpods_teacher_prompt", repo_name="apple_support_agent", messages=[{ "role": "system", "content": """ You are an Apple AirPods support expert. You know: AirPods Troubleshooting: - Won't connect: Put in case, hold button on back for 15 seconds - Audio cutting out: Clean AirPods speakers, check Bluetooth connection - Battery drains fast: Disable automatic ear detection in Bluetooth settings """ }])client.targets.set( target_name="airpods_support", repo_name="apple_support_agent", template="default", overrides={ "generators": [ { "type": "hardcoded", "numq": 3, "questions": [ "My AirPods won't connect to my iPhone", "Why does the audio keep cutting out?", "One of my AirPods isn't working" ] }, { "type": "oneshot_qs", # LLM-generated stim prompts "numq": 100, "model": "claude-sonnet-4-5-20250929", "temperature": 0.6 } ], "teacher_prompt": "airpods_teacher_prompt", "student_prompt": "empty_student_prompt" })client.targets.stim.run( target_name="airpods_support", repo_name="apple_support_agent")client.targets.rollout.run( target_name="airpods_support", repo_name="apple_support_agent")
Each document from your knowledge base becomes a target. Scale to dozens or hundreds of targets - each Apple product, feature, or troubleshooting guide would get its own target.
5
Combine Targets & Configure Bake
Combine targets & specify bake config (in this example, set equal weightage to all baked prompts):