@ai-sdk/openai-compatible provider. Point the provider at Valar’s base URL and pass any Valar model id to generateText, streamText, and the rest of the SDK.
Set up the provider
Generate text
Call
generateText with a Valar model id. See Models for the full list.Stream a response
UsestreamText to receive tokens as they are produced.
Call tools
The AI SDK’stools option works against Valar through the same provider. Define each tool with a schema and a handler, and the model can call it during generation.
Choose a completion window
Valar offers two completion windows: Now (
asap) for interactive turns, and Standard (standard) for cost-optimized work. Set one with the OpenAI-compatible provider’s request metadata, for example providerOptions: { 'valar': { completion_window: 'standard' } }. See Completion windows and Inference modes for details.