/** * LLM provider presets for `viewer.agentConfig()`. These are plain data — * the agent core is provider-agnostic (one OpenAI-chat-completions protocol * over primitive `url`/`headers`/`apiKey` connection fields), so a * "provider" is just a spreadable collection of those fields: * * ```javascript * import { providers } from "@perspective-dev/viewer"; * viewer.agentConfig({ * ...providers.anthropic, * apiKey: "sk-ant-...", * model: "claude-haiku-4-5", // spread order = override order * }); * ``` * * Any OpenAI-compatible service works without a preset — pass its full * chat-completions `url` (and `apiKey`/`headers` as needed) directly. * Cloud presets call the provider from the browser tab; suitable for local * development, or route `url` through your own proxy for production. */ /** * A spreadable connection preset for `viewer.agentConfig()`. */ export interface AgentProviderPreset { name: string; url: string; headers?: Record; model?: string; } export declare const providers: { /** * Anthropic's OpenAI-compatibility endpoint. `apiKey` required. */ readonly anthropic: { readonly name: "anthropic"; readonly url: "https://api.anthropic.com/v1/chat/completions"; readonly headers: { readonly "anthropic-dangerous-direct-browser-access": "true"; }; readonly model: "claude-opus-5"; }; /** * Google Gemini's OpenAI-compatibility endpoint. `apiKey` required. */ readonly gemini: { readonly name: "gemini"; readonly url: "https://generativelanguage.googleapis.com/v1beta/openai/chat/completions"; readonly model: "gemini-2.5-flash"; }; /** * LM Studio's local developer server (enable CORS in its settings). */ readonly lmstudio: { readonly name: "lmstudio"; readonly url: "http://localhost:1234/v1/chat/completions"; }; /** * Local Ollama (set `OLLAMA_ORIGINS` for CORS). */ readonly ollama: { readonly name: "ollama"; readonly url: "http://localhost:11434/v1/chat/completions"; }; /** * OpenRouter. `apiKey` required. */ readonly openrouter: { readonly name: "openrouter"; readonly url: "https://openrouter.ai/api/v1/chat/completions"; }; /** * OpenAI. `apiKey` required. */ readonly openai: { readonly name: "openai"; readonly url: "https://api.openai.com/v1/chat/completions"; readonly model: "gpt-5.2"; }; };