@radonsdk/ai10 providersOne chat() across 10 model providers.
OpenAI, Anthropic, Gemini, Groq, Mistral, DeepSeek, and more — one message shape, one result shape. Normalized streaming, one tool schema that works everywhere, and a raw-client escape hatch for the last 20%.
import { RadonAI } from "@radonsdk/ai";
const ai = new RadonAI({
providers: { openai: {} },
defaultProvider: "openai",
});
const res = await ai.chat({
messages: [{ role: "user", content: "Say hello in one word." }],
});
console.log(res.content); // "Hello"10 providers, one shape
Swap gpt-4o for claude or gemini with a config change — the messages you send and the result you get back never change.
Normalized streaming
ai.stream() returns an async iterable; take textStream() for deltas or final() for the assembled result.
Tools that work everywhere
Define one JSON tool schema; Radon translates it to each provider's function-calling format. This is the SDK's reason to exist — never a Pro upsell.
Embeddings
One embed() across OpenAI, Gemini, Mistral, Together, and local Ollama.
Vision & structured output
Send images and enforce JSON schemas across providers that support them, with best-effort fallbacks where they don't.
Provider fallback
Give chat() a fallback list — try Anthropic, fall back to OpenAI — for resilience under rate limits.
3 free, 7 on Pro — same call for every one.
A small, typed surface.
ai.chat({ messages, tools? }): Promise<ChatResult>One completion; returns content, toolCalls, usage, and finishReason.
ai.stream({ messages }): ChatStreamStream tokens — iterate textStream() or await final().
ai.embed({ input }): Promise<EmbedResult>PROVector embeddings across supporting providers.
ai.native() · ai.rawClient()Drop to the provider's official SDK or a preconfigured fetch client.
const stream = ai.stream({
messages: [{ role: "user", content: "Write a haiku about backups." }],
});
for await (const delta of stream.textStream()) {
process.stdout.write(delta);
}Streams are single-consumption
A ChatStream can be iterated once; call stream() again for a fresh one. stream() also commits to a single provider — fallback only applies to chat(). Not every provider does embeddings; those throw a typed UnsupportedOperationError rather than failing silently.