Models
Call models through explicit provider bindings, validated outputs and bounded execution policies.
Use inference without an Agent
createInference supplies provider-neutral generation, streaming, routing and budget admission. You can call it directly from a server operation; an Agent loop is optional.
import { createInference } from "@smoothie-framework/runtime/model";
import { createOpenAiResponsesAdapter } from "@smoothie-framework/model-providers/openai";
export function createServerInference(apiKey: string) {
return createInference({
providers: [createOpenAiResponsesAdapter()],
resolveCredential: () => ({ apiKey }),
});
}The key above is server-owned and intended for this one-provider example. Multi-provider applications select credentials by the planned provider/profile; never let model text choose arbitrary secrets.
Choose the model operation
- Providers and credentials for native and bridged integrations.
- Generate text and structured output for validated terminal results.
- Streaming and cancellation for incremental output.
- Routing, retries and fallbacks for bounded attempts.
- Usage and inference budgets for accounting and admission.