Providers
aioc executes runs through a default provider.
High-level Setup Helpers
Section titled “High-level Setup Helpers”The simplest options are:
setupMistral(options?)setupOpenAI(options?)setupProvider("mistral", options?)setupProvider("openai", options?)These helpers:
- resolve the API key from arguments or environment
- create the provider instance
- register it as the runtime default provider
API Key Resolution
Section titled “API Key Resolution”Current environment variable names:
MISTRAL_API_KEYOPENAI_API_KEY
If the key is missing both in arguments and in the environment, setup throws.
Minimal Example
Section titled “Minimal Example”import "dotenv/config";import { setupMistral } from "@axiastudio/aioc";
setupMistral();Low-level Setup
Section titled “Low-level Setup”For custom providers, the low-level route is:
setDefaultProvider(provider)The provider must implement:
interface ModelProvider { stream<TContext = unknown>( request: ProviderRequest<TContext>, ): AsyncIterable<ProviderEvent>;}When To Use The Low-level Route
Section titled “When To Use The Low-level Route”Use setDefaultProvider(...) when:
- you are integrating a provider not shipped with
aioc - you want a custom stub or scripted provider
- you want to test runtime behavior without a live model
For normal usage, prefer setupMistral(...) or setupOpenAI(...).