Guides

Build real things, step by step, with the final code included.

Each guide walks one build from empty file to working feature: what to add, what to write, and the complete final code. They line up with the compiled examples in the repository's Examples/ folder, which build on every CI run, so the code can't rot.

The example files

Every numbered file in Examples/Features/ maps to one or more guides:

ExampleGuide
01 GenerateText, 02 StreamText, 04 ProviderSwapYour first request
09 ChatSession, 19 SessionHooksA chat screen
05 Tools, 10 Agent, 20 SubagentsAndContextAn agent with tools
06 GenerateObject, 07 StreamObject, 18 SchemaStructured data
17 MultimodalAndSettingsVision and files
16 ToolApprovalsApprovals
22 RealtimeA voice assistant
03 OnDeviceOrCloudOffline first
21 UIStreamsAndTesting, 11 MiddlewareServing and testing
08 Embeddings, 12 Image, 13 Speech, 14 Video, 15 RerankMedia and embeddings
08 Embeddings, 15 RerankBuild semantic search
13 SpeechAndTranscriptionTranscribe and summarize
12 ImageGeneration, 14 VideoGenerationGenerate images and video
04 ProviderSwapUse custom endpoints and gateways
11 MiddlewareProduction reliability
23 WorkflowGuides and provider tool examplesSearch and server tools

There are also two real apps in Apps/: a ChatGPT-style chat over local Ollama, and a focused realtime voice app covering xAI, OpenAI, and Google. Run them on the iOS simulator after xcodegen generate.

On this page