Latency belongs in a job
Model calls are slow and flaky, which makes them the worst thing to do inside a request.
An AI feature is a queue, a vector index, a cache, a rate limit, a cost ledger, and a place to put the transcript. Stacks gives you all of those already wired to your models, so the interesting work is the prompt and the product rather than the plumbing around them.
The work that arrives whether you planned for it or not.
Model calls are slow and flaky, which makes them the worst thing to do inside a request.
RAG is only as good as the pipeline that keeps embeddings current with the rows they describe.
Tokens, retries, and runaway loops need metering and limits from the first release.
Being locked to one vendor SDK makes evaluating a cheaper or better model a rewrite.
All of it in the same install, typed against the rest of your application.
Anthropic, OpenAI, and Ollama share one chat API, chosen in config/ai.ts, with Bedrock alongside as its own driver for AWS-hosted models.
Generate embeddings from model changes and query an in-memory vector index for retrieval, using the same events as everything else.
Long calls run as jobs with retries and timeouts, and results stream back over realtime channels.
Talk to Model Context Protocol servers from the application, so tools and data sources are configuration.
Cache-aside for repeated prompts, rate limits per user or team, and usage recorded like any other model.
Image analysis runs on Claude or GPT and image generation runs through DALL-E, both part of the same package rather than a second integration.
Every one of these ships in the same install. Follow one to see what it covers.
Buddy scaffolds, runs, and ships this the same way it does the rest of the app.
Projects of this shape usually grow into one of these.