@radonsdk/ai10 providers

One 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%.

$npm i @radonsdk/ai
ai.ts
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"
01what you get
01

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.

02

Normalized streaming

ai.stream() returns an async iterable; take textStream() for deltas or final() for the assembled result.

03

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.

04

Embeddings

One embed() across OpenAI, Gemini, Mistral, Together, and local Ollama.

05

Vision & structured output

Send images and enforce JSON schemas across providers that support them, with best-effort fallbacks where they don't.

06

Provider fallback

Give chat() a fallback list — try Anthropic, fall back to OpenAI — for resilience under rate limits.

02providers

3 free, 7 on Pro — same call for every one.

3 freeproduction-grade, no license
OpenAIOpenAIAnthropicAnthropicGroqGroq
7 Proone key unlocks all
Google GeminiGoogle GeminiMistralMistralDeepSeekDeepSeekOpenRouterOpenRouterxAI (Grok)xAI (Grok)Together AITogether AIOllamaOllama
03the API

A small, typed surface.

  • ai.chat({ messages, tools? }): Promise<ChatResult>

    One completion; returns content, toolCalls, usage, and finishReason.

  • ai.stream({ messages }): ChatStream

    Stream tokens — iterate textStream() or await final().

  • ai.embed({ input }): Promise<EmbedResult>PRO

    Vector embeddings across supporting providers.

  • ai.native() · ai.rawClient()

    Drop to the provider's official SDK or a preconfigured fetch client.

04Stream a response
ai-example.ts
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.