Files
hack/tools/scripts/llm-key-hunter/results/_cache/content/choeng-rayu_rayu-cli.json
T

1 line
111 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{"repo": "choeng-rayu/rayu-cli", "files": {"rayu/src/utils/rayuProviders.ts": {"caca4043c11f75763539d7ad2adb24acfc0b11d8": {"t": 1785674297.7926712, "n": 31973, "h": "6ef75baacac8431c", "c": "// Shared registry of built-in provider presets for Rayu-CLI, used by both the\n// onboarding flow and the /connect command. Also imports API keys from known\n// environment variables (and a local .env) into ~/.rayu/providers.json so keys\n// the user already has in .env become first-class config entries.\nimport { existsSync, readFileSync } from 'fs'\nimport { join } from 'path'\nimport {\n type ProviderKind,\n type RayuProvider,\n getActiveProvider,\n loadRayuConfig,\n saveRayuConfig,\n} from './rayuConfig.js'\nimport { loadDotEnv } from './envUtils.js'\nimport { OLLAMA_CLOUD_BASE_URL, OLLAMA_CLOUD_PROVIDER_ID } from '../services/api/ollamaCloud.js'\n\n\nexport type ProviderPreset = {\n /** Stable provider id (also the config id). */\n id: string\n label: string\n kind: ProviderKind\n /** Base URL for openai-compatible providers (omit for bedrock / local-prompt). */\n baseURL?: string\n /** Sensible default model id (used until the live catalog is fetched). */\n defaultModel?: string\n /** Provider-native small/fast model for lightweight work and haiku aliases. */\n smallFastModel?: string\n /** Env var names whose value is the API key for this provider. */\n envKeys?: string[]\n /** True for endpoints where the user must type the base URL (no fixed host). */\n promptBaseURL?: boolean\n /**\n * True for presets authenticated via Google OAuth / Application Default\n * Credentials rather than a typed API key (e.g. Gemini on Vertex AI). The\n * /connect flow runs ADC detection / loopback login + project/region prompts\n * instead of the API-key step.\n */\n requiresOAuth?: boolean\n}\n\n// --- AWS Bedrock (API key / bearer token) -----------------------------------\n// AWS Bedrock exposes an OpenAI-compatible Chat Completions API on the\n// `bedrock-mantle` endpoint (AWS-recommended). It is region-scoped and\n// authenticated with a Bedrock API key (the AWS_BEARER_TOKEN_BEDROCK bearer\n// token). Both `GET /v1/models` and `POST /v1/chat/completions` work with that\n// token, so Rayu reuses its OpenAI-compatible adapter + model-catalog fetch\n// verbatim. Mantle (unlike the bare bedrock-runtime OpenAI surface) properly\n// separates reasoning models' chain-of-thought into `reasoning_content` and\n// parses native tool calls — required for Kimi K2 Thinking et al.\n\n/** Default AWS region used for Bedrock when none is specified. */\nexport const DEFAULT_BEDROCK_REGION = 'us-east-1'\n\n/** Build the OpenAI-compatible Bedrock base URL for a given AWS region. */\nexport function bedrockBaseURL(region: string): string {\n const r = (region || DEFAULT_BEDROCK_REGION).trim()\n // The recommended `bedrock-mantle` endpoint serves the OpenAI Chat Completions\n // API at /v1/chat/completions and the model catalog at /v1/models. Model IDs\n // on mantle use the `<vendor>.<model>` form (e.g. moonshotai.kimi-k2-thinking).\n return `https://bedrock-mantle.${r}.api.aws/v1`\n}\n\n/** AWS regions that commonly support the Bedrock runtime endpoint. */\nexport const BEDROCK_REGIONS: Array<{ id: string; label: string }> = [\n { id: 'us-east-1', label: 'US East (N. Virginia) · us-east-1' },\n { id: 'us-east-2', label: 'US East (Ohio) · us-east-2' },\n { id: 'us-west-2', label: 'US West (Oregon) · us-west-2' },\n { id: 'ap-south-1', label: 'Asia Pacific (Mumbai) · ap-south-1' },\n { id: 'ap-southeast-1', label: 'Asia Pacific (Singapore) · ap-southeast-1' },\n { id: 'ap-southeast-2', label: 'Asia Pacific (Sydney) · ap-southeast-2' },\n { id: 'ap-northeast-1', label: 'Asia Pacific (Tokyo) · ap-northeast-1' },\n { id: 'eu-central-1', label: 'Europe (Frankfurt) · eu-central-1' },\n { id: 'eu-west-1', label: 'Europe (Ireland) · eu-west-1' },\n { id: 'eu-west-3', label: 'Europe (Paris) · eu-west-3' },\n]\n\n// --- Google Vertex AI (Gemini via OAuth / ADC) ------------------------------\n// Vertex AI exposes an OpenAI-compatible Chat Completions endpoint under the\n// per-region `…/endpoints/openapi` path, authenticated with a Google Cloud\n// OAuth bearer token (cloud-platform scope) rather than a static API key. Rayu\n// reuses its OpenAI-compatible adapter with a fetch wrapper that injects a\n// freshly-minted token. The provider is project + region scoped.\n\n/** Stable provider id for the Gemini/Vertex (OAuth) preset. */\nexport const GEMINI_VERTEX_PROVIDER_ID = 'gemini-vertex'\n\n/** Default GCP location for Vertex chat. `global` serves the newest Gemini\n * models (3.x) and also the 2.x line, so it's the most compatible default. */\nexport const DEFAULT_VERTEX_REGION = 'global'\n\n/** Vertex AI host for a location: the `global` location uses the un-prefixed\n * host, every regional location uses the `{region}-` prefix. */\nexport function vertexHost(region: string): string {\n const r = (region || DEFAULT_VERTEX_REGION).trim()\n return r === 'global'\n ? 'aiplatform.googleapis.com'\n : `${r}-aiplatform.googleapis.com`\n}\n\n/**\n * Build the OpenAI-compatible Vertex AI base URL for a project + region. The\n * Chat Completions endpoint lives at `{base}/chat/completions`; model ids are\n * sent with a `google/` publisher prefix (handled at request time).\n */\nexport function vertexBaseURL(project: string, region: string): string {\n const r = (region || DEFAULT_VERTEX_REGION).trim()\n const p = project.trim()\n return `https://${vertexHost(r)}/v1beta1/projects/${p}/locations/${r}/endpoints/openapi`\n}\n\n/** GCP locations that commonly serve Gemini on Vertex AI. `global` first — it\n * hosts the newest Gemini models and is the recommended default. */\nexport const VERTEX_REGIONS: Array<{ id: string; label: string }> = [\n { id: 'global', label: 'Global (recommended — newest Gemini models) · global' },\n { id: 'us-central1', label: 'US Central (Iowa) · us-central1' },\n { id: 'us-east1', label: 'US East (S. Carolina) · us-east1' },\n { id: 'us-east4', label: 'US East (N. Virginia) · us-east4' },\n { id: 'us-west1', label: 'US West (Oregon) · us-west1' },\n { id: 'europe-west1', label: 'Europe West (Belgium) · europe-west1' },\n { id: 'europe-west4', label: 'Europe West (Netherlands) · europe-west4' },\n { id: 'asia-northeast1', label: 'Asia Northeast (Tokyo) · asia-northeast1' },\n { id: 'asia-southeast1', label: 'Asia Southeast (Singapore) · asia-southeast1' },\n]\n\n\n// --- Ollama (local) ---------------------------------------------------------\n// Ollama serves an OpenAI-compatible API at http://localhost:11434/v1 (plus its\n// native /api surface). No API key is required. The address can be overridden\n// with the standard OLLAMA_HOST env var (a bare port, host:port, or full URL),\n// matching the Ollama CLI, so Rayu auto-detects a server started elsewhere.\nexport const OLLAMA_DEFAULT_BASE_URL = 'http://localhost:11434/v1'\n\n/** OpenAI-compatible base URL for a local Ollama server, honoring OLLAMA_HOST. */\nexport function ollamaBaseURL(): string {\n let raw = (process.env.OLLAMA_HOST || '').trim()\n if (!raw) return OLLAMA_DEFAULT_BASE_URL\n if (/^\\d+$/.test(raw)) raw = `localhost:${raw}` // bare port, e.g. \"11434\"\n if (!/^https?:\\/\\//i.test(raw)) raw = `http://${raw}` // host or host:port\n raw = raw.replace(/\\/+$/, '')\n if (!/\\/v1(\\/.*)?$/.test(raw)) raw = `${raw}/v1` // ensure the OpenAI /v1 base\n return raw\n}\n\n\n// All confirmed OpenAI-compatible providers (tool calling + /v1/models), plus\n// AWS Bedrock via its OpenAI-compatible bedrock-runtime endpoint (authenticated\n// with a Bedrock API key / bearer token). Rayu connects to OpenAI-compatible\n// endpoints; Bedrock is routed through the same adapter once a region + API key\n// are supplied via /connect.\n/** Stable provider id for the Rayu-hosted gateway provider (registered on\n * login for paid users; not connected manually via /connect). */\nexport const RAYU_HOSTED_PROVIDER_ID = 'rayu-hosted'\nexport const RAYU_HOSTED_PROVIDER_LABEL = 'Rayu (hosted)'\n\n/**\n * Built-in providers that support storing MULTIPLE API keys with automatic\n * rate-limit key rotation:\n * • NVIDIA / OpenRouter — openai-compatible → rotation in openaiAdapter\n * (withKeyRotation).\n * • Ollama Cloud — anthropic-compatible → rotation in anthropicMessagesClient\n * (makeKeyRotatingFetch), since it uses the native Anthropic SDK path.\n * The rotation mechanism is generic per client kind, so enabling another\n * provider is just adding its id here — or, with no code change, via the\n * RAYU_MULTI_KEY_PROVIDERS env var (see envMultiKeyProviderIds below). Always\n * Basic-plan gated via isMultiApiKeyAllowed().\n */\nexport const MULTI_KEY_PROVIDER_IDS: ReadonlySet<string> = new Set([\n 'nvidia',\n 'openrouter',\n 'ollama-cloud',\n])\n\n/**\n * Extra multi-key provider ids from the RAYU_MULTI_KEY_PROVIDERS env var\n * (comma- or space-separated), unioned with the built-in set above. This is the\n * self-serve knob: to give ANOTHER provider multi-API-key rotation you just add\n * its id in .env — no code change, no new release. e.g.\n * RAYU_MULTI_KEY_PROVIDERS=deepseek,groq\n * (Still Basic-plan gated via isMultiApiKeyAllowed(), same as the built-ins.)\n */\nfunction envMultiKeyProviderIds(): string[] {\n const raw = process.env.RAYU_MULTI_KEY_PROVIDERS\n if (!raw) return []\n return raw\n .split(/[\\s,]+/)\n .map(s => s.trim())\n .filter(Boolean)\n}\n\n/**\n * Provider kinds whose auth is a ROTATABLE user-supplied API key sent as a\n * request header. Multi-key rotation is ONLY wired for these two client paths\n * (openaiAdapter.withKeyRotation + anthropicMessagesClient.makeKeyRotatingFetch).\n *\n * Every other kind is intentionally excluded, because their credential is NOT a\n * rotatable user API key:\n * • 'anthropic' — first-party Console key (single x-api-key)\n * • 'kiro' — Kiro/CodeWhisperer (an apikey OR kiro-cli OAuth token)\n * • 'vertex' — Google OAuth / ADC\n * • 'genai' — Login-with-Gemini OAuth\n * • 'copilot' — GitHub OAuth device flow\n * • 'bedrock' — AWS creds / bearer token\n * • 'rayu-hosted' — Rayu account JWT via the gateway\n * This is the HARD guard behind the user requirement: multi-key is for BYO\n * API-key providers only — never Kiro, never an Auth/managed-credential provider.\n */\nconst MULTI_KEY_PROVIDER_KINDS: ReadonlySet<ProviderKind> = new Set<ProviderKind>([\n 'openai-compatible',\n 'anthropic-compatible',\n])\n\n/**\n * Resolve a provider's kind by id: the configured provider first (covers custom\n * / local ids the user added), then the built-in preset. Undefined only for a\n * brand-new id that is neither configured nor a preset.\n */\nfunction providerKindForId(providerId: string): ProviderKind | undefined {\n const configured = loadRayuConfig().providers.find(p => p.id === providerId)\n if (configured) return configured.kind\n return PROVIDER_PRESETS.find(p => p.id === providerId)?.kind\n}\n\n/**\n * True when a provider supports the multi-API-key manager + rotation.\n *\n * Two conditions, BOTH required:\n * 1. the id is explicitly allowed — a built-in (nvidia/openrouter/ollama-cloud)\n * or opted-in via RAYU_MULTI_KEY_PROVIDERS; AND\n * 2. its kind authenticates with a rotatable user API key (openai-compatible or\n * anthropic-compatible).\n *\n * Condition 2 is the safety net: even if someone mistakenly adds `kiro` or an\n * OAuth provider id to RAYU_MULTI_KEY_PROVIDERS, it can NEVER become multi-key,\n * because rotation only exists for — and only makes sense for — user-API-key\n * providers. An id whose kind can't be resolved (neither configured nor a known\n * preset) is DENIED — we only enable multi-key once we can confirm the provider\n * authenticates with a rotatable user API key.\n */\nexport function supportsMultiApiKey(providerId: string | undefined): boolean {\n if (!providerId) return false\n const listed =\n MULTI_KEY_PROVIDER_IDS.has(providerId) ||\n envMultiKeyProviderIds().includes(providerId)\n if (!listed) return false\n const kind = providerKindForId(providerId)\n return kind !== undefined && MULTI_KEY_PROVIDER_KINDS.has(kind)\n}\n\nexport const PROVIDER_PRESETS: ProviderPreset[] = [\n {\n // First-party Anthropic API (the Console — console.anthropic.com). Uses the\n // native Anthropic Messages API via getAnthropicClient() (kind:'anthropic'\n // → getAPIProvider() === 'anthropic'), the SAME path the app uses for\n // first-party Claude. That means extended THINKING and the full CONTEXT\n // window (incl. the 1M-token context beta) are supported NATIVELY — not\n // emulated through the OpenAI-compatible adapter. Authenticated with a\n // Console API key (sk-ant-…) sent as x-api-key directly to\n // api.anthropic.com. No baseURL: first-party endpoint is the SDK default.\n id: 'anthropic',\n label: 'Anthropic — Claude (console.anthropic.com API key) · native thinking + context',\n kind: 'anthropic',\n defaultModel: 'claude-sonnet-4-6',\n smallFastModel: 'claude-haiku-4-5-20251001',\n envKeys: ['ANTHROPIC_API_KEY'],\n },\n {\n // LongCat — Meituan's LongCat-2.0, exposed via an Anthropic-compatible\n // Messages API at https://api.longcat.chat/anthropic/v1/messages,\n // authenticated with `Authorization: Bearer <key>` (NOT x-api-key). Rayu\n // talks to it with the NATIVE Anthropic SDK (kind:'anthropic-compatible')\n // pointed at that baseURL, with the key sent as a Bearer authToken — so\n // extended THINKING and the full 1M-token CONTEXT work NATIVELY, not\n // emulated through the OpenAI-compatible adapter (the same reasoning as the\n // first-party 'anthropic' preset above). One model today: LongCat-2.0 (1M\n // context — see KNOWN_MODEL_CONTEXT in rayuConfig.ts). LongCat also offers an\n // OpenAI-compatible surface, but the Anthropic path maps 1:1 with claude.ts.\n // Docs: https://longcat.chat/platform/docs/APIDocs.html\n id: 'longcat',\n label: 'LongCat — Meituan (api.longcat.chat) · LongCat-2.0 1M ctx · native thinking',\n kind: 'anthropic-compatible',\n baseURL: 'https://api.longcat.chat/anthropic',\n defaultModel: 'LongCat-2.0',\n envKeys: ['LONGCAT_API_KEY'],\n },\n {\n // Ollama Cloud — Ollama's HOSTED models (ollama.com), a SEPARATE connector\n // from the local `ollama` preset (localhost, no key). Exposed via an\n // Anthropic-compatible Messages API at https://ollama.com/v1/messages,\n // authenticated with `Authorization: Bearer <ollama.com API key>`. Rayu uses\n // the NATIVE Anthropic SDK (kind:'anthropic-compatible' → the key is sent as\n // a Bearer authToken) so thinking + tools map 1:1 with claude.ts. Unlike a\n // single-model preset, the /connect flow FETCHES the user's account models\n // (fetchOllamaCloudModels → GET /v1/models, /api/tags fallback) and their\n // real context windows (POST /api/show → model_info.<arch>.context_length;\n // the KNOWN_MODEL_CONTEXT table is the fallback). Cloud model ids carry a\n // `-cloud`/`:cloud` tag, e.g. gpt-oss:120b-cloud, qwen3-coder:cloud.\n // Docs: https://docs.ollama.com/api/anthropic-compatibility\n id: OLLAMA_CLOUD_PROVIDER_ID,\n label: 'Ollama Cloud (ollama.com) · hosted models · fetches your account models',\n kind: 'anthropic-compatible',\n baseURL: OLLAMA_CLOUD_BASE_URL,\n defaultModel: 'gpt-oss:120b-cloud',\n envKeys: ['OLLAMA_CLOUD_API_KEY'],\n },\n {\n id: 'nvidia',\n label: 'NVIDIA NIM (integrate.api.nvidia.com)',\n kind: 'openai-compatible',\n baseURL: 'https://integrate.api.nvidia.com/v1',\n defaultModel: 'meta/llama-3.3-70b-instruct',\n smallFastModel: 'nvidia/llama-3.1-nemotron-nano-8b-v1',\n envKeys: ['NVIDIA_API_KEY'],\n },\n {\n id: 'doubleword',\n label: 'Doubleword (api.doubleword.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.doubleword.ai/v1',\n defaultModel: 'moonshotai/Kimi-K2.6',\n smallFastModel: 'Qwen/Qwen3.5-9B',\n envKeys: ['DOUBLE_WORD_API_KEY', 'DOUBLEWORD_API_KEY'],\n },\n {\n id: 'deepseek',\n label: 'DeepSeek (api.deepseek.com)',\n kind: 'openai-compatible',\n baseURL: 'https://api.deepseek.com/v1',\n defaultModel: 'deepseek-chat',\n smallFastModel: 'deepseek-v4-flash',\n envKeys: ['DEEPSEEK_API_KEY'],\n },\n {\n // Z.ai — GLM family (Zhipu AI). OpenAI-compatible Chat Completions at\n // https://api.z.ai/api/paas/v4/chat/completions, authenticated with a Bearer\n // API key. GLM-5.2 is the current flagship coding/agent model with a 1M-token\n // context window; GLM-4.6 is 200K; GLM-4.5 / 4.5-Air are 128K. Thinking is\n // NATIVE: GLM-4.5+ emit chain-of-thought in the `reasoning_content` field,\n // which the OpenAI adapter surfaces as a thinking block. Z.ai has NO\n // OpenAI-style `GET /models`, so the full lineup comes from the curated\n // catalog in curatedProviderModels.ts (merged with any live fetch). Per-model\n // context windows live in KNOWN_MODEL_CONTEXT (rayuConfig.ts). Docs:\n // https://docs.z.ai/api-reference/llm/chat-completion\n id: 'glm',\n label: 'GLM — Z.ai (api.z.ai) · GLM-5.2 1M ctx / GLM-4.6 200K · native thinking',\n kind: 'openai-compatible',\n baseURL: 'https://api.z.ai/api/paas/v4',\n defaultModel: 'glm-5.2',\n smallFastModel: 'glm-4.5-air',\n envKeys: ['ZAI_API_KEY', 'ZHIPUAI_API_KEY', 'GLM_API_KEY'],\n },\n {\n // MiniMax — M-series language models. OpenAI-compatible Chat Completions at\n // https://api.minimax.io/v1/chat/completions (Bearer MINIMAX_API_KEY).\n // MiniMax-M3 is the frontier coding/agent model with a 1M-token context;\n // MiniMax-M2 / M2.x are 204,800. Thinking is NATIVE and ON by default\n // (M2.x always think; M3 thinks unless disabled): reasoning is returned\n // either as `reasoning_content` (reasoning_split) or inline <think>…</think>\n // at the start of the message — the OpenAI adapter surfaces BOTH as a\n // thinking block (processInlineThink). Per-model context lives in\n // KNOWN_MODEL_CONTEXT (rayuConfig.ts). Docs:\n // https://platform.minimax.io/docs/api-reference/text-openai-api\n id: 'minimax',\n label: 'MiniMax (api.minimax.io) · M3 1M ctx / M2 reasoning · native thinking',\n kind: 'openai-compatible',\n baseURL: 'https://api.minimax.io/v1',\n defaultModel: 'MiniMax-M2',\n smallFastModel: 'MiniMax-M2',\n envKeys: ['MINIMAX_API_KEY'],\n },\n {\n id: 'kimi-moonshot',\n label: 'Kimi / Moonshot (api.moonshot.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.moonshot.ai/v1',\n defaultModel: 'kimi-k2.6',\n smallFastModel: 'kimi-k2.6',\n envKeys: ['KIMI_API_KEY', 'MOONSHOT_API_KEY'],\n },\n {\n id: 'kimi-for-code',\n label: 'Kimi for Code (api.kimi.com/coding)',\n kind: 'openai-compatible',\n baseURL: 'https://api.kimi.com/coding/v1',\n defaultModel: 'kimi-for-coding',\n smallFastModel: 'kimi-for-coding',\n envKeys: ['KIMI_FOR_CODE_API_KEY'],\n },\n {\n // Fugu — Sakana AI's multi-agent system (Japan). Although it's an agentic\n // multi-agent system under the hood, it's exposed like a standard LLM\n // through the OpenAI-compatible Sakana API: `POST /v1/chat/completions`\n // (and the Responses API) at https://api.sakana.ai/v1, authenticated with a\n // Bearer SAKANA_API_KEY. Rayu reuses its OpenAI-compatible adapter + live\n // `GET /v1/models` catalog verbatim. Two models ship: `fugu` (default;\n // routes across providers) and `fugu-ultra` (premium). Both have a 1M-token\n // context window — see KNOWN_MODEL_CONTEXT in rayuConfig.ts. Docs:\n // https://console.sakana.ai/get-started\n id: 'fugu',\n label: 'Fugu — Sakana AI (api.sakana.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.sakana.ai/v1',\n defaultModel: 'fugu',\n smallFastModel: 'fugu',\n envKeys: ['SAKANA_API_KEY'],\n },\n {\n id: 'openai',\n label: 'OpenAI (api.openai.com)',\n kind: 'openai-compatible',\n baseURL: 'https://api.openai.com/v1',\n defaultModel: 'gpt-4o',\n smallFastModel: 'gpt-4o-mini',\n envKeys: ['OPENAI_API_KEY'],\n },\n {\n // Google Gemini via its OpenAI-compatible surface. The\n // generativelanguage endpoint exposes /chat/completions and /models under\n // the /v1beta/openai path, authenticated with a Gemini API key, so Rayu can\n // reuse its OpenAI-compatible adapter + live model-catalog fetch verbatim.\n // (The OAuth/Vertex path is a separate preset — see GEMINI_VERTEX_PRESET.)\n // No hardcoded defaultModel: the catalog is fetched live and the picker\n // chooses (e.g. gemini-2.5-flash / gemini-3.x-flash as they ship).\n id: 'gemini',\n label: 'Google Gemini — API key (generativelanguage.googleapis.com)',\n kind: 'openai-compatible',\n baseURL: 'https://generativelanguage.googleapis.com/v1beta/openai',\n envKeys: ['GEMINI_API_KEY', 'GOOGLE_API_KEY'],\n },\n {\n // Gemini on Google Vertex AI, authenticated with Google OAuth /\n // Application Default Credentials (no static API key). Project + region\n // scoped; the base URL is computed from the values chosen/detected in\n // /connect (vertexBaseURL). Chat is served through the OpenAI-compatible\n // adapter via a fetch wrapper that injects a fresh bearer token.\n id: GEMINI_VERTEX_PROVIDER_ID,\n label: 'Google Gemini — Vertex AI (OAuth / ADC) · recommended for heavy use',\n kind: 'vertex',\n requiresOAuth: true,\n },\n {\n // \"Login with Gemini\" — interactive Google sign-in (user's Desktop OAuth\n // client). Served by the @google/genai adapter in Vertex mode on the\n // `global` location, using the project from the client/login. No API key\n // or gcloud/ADC required.\n id: 'gemini-login',\n label: 'Login with Gemini (Google account) · free/Pro consumer quota',\n kind: 'genai',\n requiresOAuth: true,\n },\n {\n // GitHub Copilot — sign in with GitHub (OAuth device flow) and use your\n // Copilot subscription's models (Claude, GPT, Gemini, …) via Copilot's\n // OpenAI-compatible endpoint (api.githubcopilot.com). No API key to paste:\n // the GitHub OAuth token is exchanged for a short-lived Copilot token that\n // is auto-refreshed. Reuses the OpenAI adapter through a token-injecting\n // fetch wrapper (handled by kind:'copilot' in client.ts).\n id: 'copilot',\n label: 'GitHub Copilot (sign in with GitHub) · uses your Copilot subscription',\n kind: 'copilot',\n },\n {\n id: 'openrouter',\n label: 'OpenRouter (openrouter.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://openrouter.ai/api/v1',\n defaultModel: 'anthropic/claude-3.5-sonnet',\n smallFastModel: 'openai/gpt-4o-mini',\n envKeys: ['OPENROUTER_API_KEY'],\n },\n {\n id: 'xai',\n label: 'xAI / Grok (api.x.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.x.ai/v1',\n defaultModel: 'grok-4',\n smallFastModel: 'grok-3-mini',\n envKeys: ['XAI_API_KEY'],\n },\n {\n id: 'groq',\n label: 'Groq (api.groq.com)',\n kind: 'openai-compatible',\n baseURL: 'https://api.groq.com/openai/v1',\n defaultModel: 'llama-3.3-70b-versatile',\n smallFastModel: 'llama-3.1-8b-instant',\n envKeys: ['GROQ_API_KEY'],\n },\n {\n id: 'fireworks',\n label: 'Fireworks AI (api.fireworks.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.fireworks.ai/inference/v1',\n defaultModel: 'accounts/fireworks/models/llama-v3p3-70b-instruct',\n envKeys: ['FIREWORKS_API_KEY'],\n },\n {\n id: 'togetherai',\n label: 'Together AI (api.together.xyz)',\n kind: 'openai-compatible',\n baseURL: 'https://api.together.xyz/v1',\n defaultModel: 'meta-llama/Llama-3.3-70B-Instruct-Turbo',\n envKeys: ['TOGETHER_API_KEY', 'TOGETHERAI_API_KEY'],\n },\n {\n id: 'cerebras',\n label: 'Cerebras (api.cerebras.ai)',\n kind: 'openai-compatible',\n baseURL: 'https://api.cerebras.ai/v1',\n defaultModel: 'llama-3.3-70b',\n envKeys: ['CEREBRAS_API_KEY'],\n },\n {\n id: 'baseten',\n label: 'Baseten (inference.baseten.co)',\n kind: 'openai-compatible',\n baseURL: 'https://inference.baseten.co/v1',\n envKeys: ['BASETEN_API_KEY'],\n },\n {\n id: 'deepinfra',\n label: 'DeepInfra (api.deepinfra.com)',\n kind: 'openai-compatible',\n baseURL: 'https://api.deepinfra.com/v1/openai',\n defaultModel: 'meta-llama/Llama-3.3-70B-Instruct',\n envKeys: ['DEEPINFRA_API_KEY'],\n },\n {\n // Hugging Face Inference Providers — an OpenAI-compatible router\n // (router.huggingface.co/v1) that fans a single `<org>/<model>` id out to\n // the available inference providers (novita, together, fireworks, …).\n // `GET /v1/models` returns the live cross-provider catalog, so Rayu's\n // generic openai-compatible adapter + model fetch work verbatim. Auth is a\n // Hugging Face access token (hf_…), read from the standard HF env vars.\n id: 'huggingface',\n label: 'Hugging Face — Inference Providers (router.huggingface.co)',\n kind: 'openai-compatible',\n baseURL: 'https://router.huggingface.co/v1',\n defaultModel: 'deepseek-ai/DeepSeek-V4-Pro',\n smallFastModel: 'deepseek-ai/DeepSeek-V4-Flash',\n envKeys: ['HF_TOKEN', 'HUGGINGFACE_API_KEY', 'HUGGING_FACE_HUB_TOKEN'],\n },\n {\n id: 'bedrock',\n label: 'AWS Bedrock — all models (Claude + open-weight)',\n kind: 'bedrock',\n // ONE Bedrock provider for the whole catalog. The wire format is chosen per\n // MODEL by resolveWireFormat(): Claude inference profiles speak the Anthropic\n // Messages API (bedrock-runtime invoke endpoints), and the models Bedrock\n // flags `openAiChatCompletions` speak OpenAI Chat Completions on the\n // bedrock-mantle endpoint. Region-scoped, so no fixed baseURL here — the\n // wizard sets the mantle baseURL after the region is chosen. Models are\n // fetched live from the Bedrock control plane.\n envKeys: ['AWS_BEARER_TOKEN_BEDROCK'],\n },\n {\n id: 'azure',\n label: 'Microsoft Azure — all deployments (Claude + Azure OpenAI)',\n kind: 'azure',\n // ONE Azure resource serving both wire formats, chosen per MODEL:\n // Claude deployments → Anthropic Messages at {origin}/anthropic;\n // everything else → Azure OpenAI v1 Responses at {origin}/openai/v1.\n // The endpoint is derived from the resource name entered in /connect, so no\n // fixed baseURL here. Deployments are fetched live.\n envKeys: ['ANTHROPIC_FOUNDRY_API_KEY', 'AZURE_OPENAI_API_KEY'],\n },\n {\n id: 'kiro',\n label: 'Kiro — Claude via AWS (API key or kiro-cli login)',\n kind: 'kiro',\n defaultModel: 'claude-sonnet-4.6',\n smallFastModel: 'claude-haiku-4.5',\n envKeys: ['KIRO_API_KEY'],\n // No fixed baseURL: region-scoped AWS CodeWhisperer endpoint, reached via a\n // dedicated adapter (src/services/api/kiroAdapter.ts). Auth + the adapter\n // are lazy-loaded only when the active provider is kind:'kiro'.\n },\n {\n id: 'ollama',\n label: 'Ollama (local · auto-detect)',\n kind: 'openai-compatible',\n baseURL: OLLAMA_DEFAULT_BASE_URL,\n // No envKeys / API key: Ollama needs none. Connected via /connect →\n // Localhost → Ollama, which probes the server and lists its pulled models.\n },\n {\n id: 'local',\n label: 'Local / custom OpenAI-compatible endpoint',\n kind: 'openai-compatible',\n promptBaseURL: true,\n },\n]\n\n\n\n/**\n * Import API keys from known env vars / .env into the provider config. Adds a\n * provider entry for each env key found that isn't already configured with a\n * key. Sets the first imported provider active only if none is active yet.\n * SECURITY: keys are written to the 0600 config file; never logged.\n */\nexport function migrateEnvKeysToConfig(): void {\n loadDotEnv()\n const cfg = loadRayuConfig()\n let changed = false\n for (const provider of cfg.providers) {\n const preset = PROVIDER_PRESETS.find(p => p.id === provider.id)\n if (!preset) continue\n if (!provider.baseURL && preset.baseURL) {\n provider.baseURL = preset.baseURL\n changed = true\n }\n if (!provider.defaultModel && preset.defaultModel) {\n provider.defaultModel = preset.defaultModel\n changed = true\n }\n if (!provider.smallFastModel && preset.smallFastModel) {\n provider.smallFastModel = preset.smallFastModel\n changed = true\n }\n }\n for (const preset of PROVIDER_PRESETS) {\n const key = preset.envKeys\n ?.map(k => process.env[k])\n .find(v => typeof v === 'string' && v.length > 0)\n if (!key) continue\n const existing = cfg.providers.find(p => p.id === preset.id)\n if (existing?.apiKey) continue // already configured with a key\n // Bedrock is region-scoped: derive region from AWS env (or default) and\n // compute the OpenAI-compatible bedrock-runtime base URL from it.\n const isBedrock = preset.kind === 'bedrock'\n const region = isBedrock\n ? (process.env.AWS_REGION ||\n process.env.AWS_DEFAULT_REGION ||\n DEFAULT_BEDROCK_REGION)\n : undefined\n const baseURL = isBedrock ? bedrockBaseURL(region as string) : preset.baseURL\n if (existing) {\n existing.apiKey = key\n existing.baseURL ??= baseURL\n existing.defaultModel ??= preset.defaultModel\n existing.smallFastModel ??= preset.smallFastModel\n if (isBedrock) existing.awsRegion ??= region\n } else {\n cfg.providers.push({\n id: preset.id,\n kind: preset.kind,\n apiKey: key,\n ...(baseURL ? { baseURL } : {}),\n ...(preset.defaultModel ? { defaultModel: preset.defaultModel } : {}),\n ...(preset.smallFastModel ? { smallFastModel: preset.smallFastModel } : {}),\n ...(isBedrock ? { awsRegion: region } : {}),\n })\n }\n changed = true\n }\n if (changed) {\n cfg.activeProvider ??= cfg.providers[0]?.id\n saveRayuConfig(cfg)\n }\n}\n\n\n// --- Provider display names (header / status line) --------------------------\n// Short, human-friendly names shown next to the model in the logo/header (e.g.\n// \"gemini-3.5-flash · Vertex AI\") in place of the generic \"API Usage Billing\".\n\n/** Short, branded names keyed by provider id. */\nconst PROVIDER_DISPLAY_NAMES: Record<string, string> = {\n anthropic: 'Anthropic',\n longcat: 'LongCat',\n nvidia: 'NVIDIA',\n doubleword: 'Doubleword',\n deepseek: 'DeepSeek',\n glm: 'GLM',\n minimax: 'MiniMax',\n 'kimi-moonshot': 'Kimi',\n 'kimi-for-code': 'Kimi for Code',\n fugu: 'Fugu',\n openai: 'OpenAI',\n gemini: 'Gemini',\n [GEMINI_VERTEX_PROVIDER_ID]: 'Vertex AI',\n 'gemini-login': 'Gemini',\n openrouter: 'OpenRouter',\n xai: 'xAI',\n groq: 'Groq',\n fireworks: 'Fireworks AI',\n togetherai: 'Together AI',\n cerebras: 'Cerebras',\n baseten: 'Baseten',\n deepinfra: 'DeepInfra',\n huggingface: 'Hugging Face',\n bedrock: 'AWS Bedrock',\n 'bedrock-openai': 'AWS Bedrock',\n 'bedrock-anthropic': 'AWS Bedrock',\n kiro: 'Kiro',\n copilot: 'GitHub Copilot',\n 'rayu-hosted': 'Rayu',\n ollama: 'Ollama',\n 'ollama-cloud': 'Ollama Cloud',\n local: 'Local',\n}\n\n/** Fallback name derived from the provider kind when the id isn't known. */\nfunction providerKindName(kind: ProviderKind): string {\n switch (kind) {\n case 'vertex':\n return 'Vertex AI'\n case 'bedrock':\n return 'AWS Bedrock'\n case 'genai':\n return 'Gemini'\n case 'kiro':\n return 'Kiro'\n case 'copilot':\n return 'GitHub Copilot'\n case 'anthropic':\n return 'Anthropic'\n case 'anthropic-compatible':\n return 'Anthropic-compatible'\n default:\n return 'OpenAI-compatible'\n }\n}\n\n/**\n * Human-friendly display name for a configured provider — id-aware, with a\n * kind-based fallback, plus a localhost hint so custom Ollama endpoints still\n * read as \"Ollama\".\n */\nexport function providerDisplayName(provider: RayuProvider): string {\n const known = PROVIDER_DISPLAY_NAMES[provider.id]\n if (known) return known\n if (\n provider.kind === 'openai-compatible' &&\n provider.baseURL &&\n /(?:\\/\\/|@)(?:localhost|127\\.0\\.0\\.1)(?::\\d+)?|:11434(?:\\/|$)/.test(\n provider.baseURL,\n )\n ) {\n return 'Ollama'\n }\n return providerKindName(provider.kind)\n}\n\n/**\n * Short display name for the ACTIVE provider (e.g. \"Vertex AI\", \"Ollama\",\n * \"NVIDIA\"), or undefined when no provider is configured yet.\n */\nexport function getActiveProviderDisplayName(): string | undefined {\n const p = getActiveProvider()\n return p ? providerDisplayName(p) : undefined\n}\n"}}, "rayu-backend/src/models/models.constants.ts": {"caca4043c11f75763539d7ad2adb24acfc0b11d8": {"t": 1785745603.355017, "n": 12759, "h": "54c58cf15e897564", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n /**\n * Name of the provider row (providers.name) this model routes through. All\n * routing config — base URL, wire format, auth scheme, key env — lives on that\n * provider, so a model only needs to name it plus its own upstream model id.\n */\n providerName: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n /** Credit charge for INPUT tokens (credits per 1M). */\n creditMultiplier: number\n /** Credit charge for OUTPUT tokens; defaults to the input charge. */\n outputCreditMultiplier?: number\n /** Credit charge for cache-HIT prompt tokens (absolute, not a ratio). */\n cacheReadCreditMultiplier?: number\n /** Credit charge for cache-CREATION prompt tokens; defaults to input. */\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n /**\n * Context window in TOKENS (e.g. 200_000, 1_000_000). Optional: when omitted\n * the CLI falls back to its own default for the model. Admin-editable.\n */\n contextWindow?: number\n /** Model speaks a thinking/reasoning parameter. */\n supportsReasoning: boolean\n /** Model accepts image content blocks. */\n supportsImage: boolean\n /** Model accepts tool/function definitions. */\n supportsTools?: boolean\n enabled: boolean\n}\n\n// Provider names must match rows in the provider registry (see\n// providers/providers.constants.ts PROVIDER_SEED and migration\n// 0000000000009_providers). Renaming a provider in the dashboard detaches these\n// seeds — seedDefaults then logs a warning and skips, rather than failing boot.\nconst OLLAMA_PROVIDER = 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed DIRECT to DeepSeek's own API via its Anthropic-compatible\n // endpoint (provider 'deepseek'). The gateway's built-in default for this\n // provider is Auth:x-api-key + Endpoint:anthropic (see knownProviderDefaults in\n // rayu-gateway/internal/config/config.go), so handleAnthropicMessages forwards\n // to https://api.deepseek.com/anthropic/v1/messages keyed by the gateway's\n // DEEPSEEK_API_KEY. This is the NATIVE rayu-hosted path — the CLI talks the\n // Anthropic SDK to the gateway's /anthropic base (see rayuHostedClient.ts), so\n // thinking / tools / prompt-cache usage map 1:1 with no OpenAI translation.\n // upstreamModelId is DeepSeek's own model id (NOT an Ollama `:cloud` tag):\n // deepseek-v4-pro → deepseek-v4-pro\n // deepseek-v4-flash → deepseek-v4-flash\n // NOTE: for this to route, the 'deepseek' provider row must be enabled (Admin →\n // Providers) and DEEPSEEK_API_KEY must be set in the gateway env.\n // input==output price → FLAT billing, so creditMultiplier is exactly credits\n // per 1M tokens (pro = 1.0 → 1 credit/1M; flash = 0.33). The CLI resolves the\n // deepseek-v4 codes to 1M context — add a per-model override if the real\n // model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n providerName: 'deepseek',\n upstreamModelId: 'deepseek-v4-flash', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat 0.33 credits / 1M tokens\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n providerName: 'deepseek',\n upstreamModelId: 'deepseek-v4-pro', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat, exactly 1 credit / 1M tokens\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n providerName: 'longcat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 Code (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n // Ollama's real id is 'kimi-k2.7-code' (NOT 'kimi-k2.7:cloud' — that 404s).\n // Verified against ollama.com/api/tags. NOTE: this model is subscription-gated\n // on Ollama (403 \"requires a subscription\") until the account's plan includes it.\n upstreamModelId: 'kimi-k2.7-code',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: false,\n supportsImage: true,\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n]\n"}, "9a3b056dbfac675c333915dd4a46a2b04559ec3b": {"t": 1785754691.44766, "n": 12759, "h": "54c58cf15e897564", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n /**\n * Name of the provider row (providers.name) this model routes through. All\n * routing config — base URL, wire format, auth scheme, key env — lives on that\n * provider, so a model only needs to name it plus its own upstream model id.\n */\n providerName: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n /** Credit charge for INPUT tokens (credits per 1M). */\n creditMultiplier: number\n /** Credit charge for OUTPUT tokens; defaults to the input charge. */\n outputCreditMultiplier?: number\n /** Credit charge for cache-HIT prompt tokens (absolute, not a ratio). */\n cacheReadCreditMultiplier?: number\n /** Credit charge for cache-CREATION prompt tokens; defaults to input. */\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n /**\n * Context window in TOKENS (e.g. 200_000, 1_000_000). Optional: when omitted\n * the CLI falls back to its own default for the model. Admin-editable.\n */\n contextWindow?: number\n /** Model speaks a thinking/reasoning parameter. */\n supportsReasoning: boolean\n /** Model accepts image content blocks. */\n supportsImage: boolean\n /** Model accepts tool/function definitions. */\n supportsTools?: boolean\n enabled: boolean\n}\n\n// Provider names must match rows in the provider registry (see\n// providers/providers.constants.ts PROVIDER_SEED and migration\n// 0000000000009_providers). Renaming a provider in the dashboard detaches these\n// seeds — seedDefaults then logs a warning and skips, rather than failing boot.\nconst OLLAMA_PROVIDER = 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed DIRECT to DeepSeek's own API via its Anthropic-compatible\n // endpoint (provider 'deepseek'). The gateway's built-in default for this\n // provider is Auth:x-api-key + Endpoint:anthropic (see knownProviderDefaults in\n // rayu-gateway/internal/config/config.go), so handleAnthropicMessages forwards\n // to https://api.deepseek.com/anthropic/v1/messages keyed by the gateway's\n // DEEPSEEK_API_KEY. This is the NATIVE rayu-hosted path — the CLI talks the\n // Anthropic SDK to the gateway's /anthropic base (see rayuHostedClient.ts), so\n // thinking / tools / prompt-cache usage map 1:1 with no OpenAI translation.\n // upstreamModelId is DeepSeek's own model id (NOT an Ollama `:cloud` tag):\n // deepseek-v4-pro → deepseek-v4-pro\n // deepseek-v4-flash → deepseek-v4-flash\n // NOTE: for this to route, the 'deepseek' provider row must be enabled (Admin →\n // Providers) and DEEPSEEK_API_KEY must be set in the gateway env.\n // input==output price → FLAT billing, so creditMultiplier is exactly credits\n // per 1M tokens (pro = 1.0 → 1 credit/1M; flash = 0.33). The CLI resolves the\n // deepseek-v4 codes to 1M context — add a per-model override if the real\n // model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n providerName: 'deepseek',\n upstreamModelId: 'deepseek-v4-flash', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat 0.33 credits / 1M tokens\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n providerName: 'deepseek',\n upstreamModelId: 'deepseek-v4-pro', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat, exactly 1 credit / 1M tokens\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n providerName: 'longcat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 1_000_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 Code (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n // Ollama's real id is 'kimi-k2.7-code' (NOT 'kimi-k2.7:cloud' — that 404s).\n // Verified against ollama.com/api/tags. NOTE: this model is subscription-gated\n // on Ollama (403 \"requires a subscription\") until the account's plan includes it.\n upstreamModelId: 'kimi-k2.7-code',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: false,\n supportsImage: true,\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 128_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n providerName: OLLAMA_PROVIDER,\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n // Context window in tokens (admin-editable; the CLI budgets against it).\n contextWindow: 256_000,\n // Capability flags: the gateway rejects an image block / thinking field\n // for a model whose flag is false, and the CLI warns the user to switch\n // models. Admin-tunable per model in the dashboard.\n supportsReasoning: true,\n supportsImage: false,\n enabled: true,\n },\n]\n"}, "cea6b95d7872983602641db216bcd339c7cb8ce4": {"t": 1785754693.8501897, "n": 8522, "h": "e907a947e2bec1be", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// Ollama Cloud's provider name is configurable via OLLAMA_PROVIDER_NAME (default\n// 'rayu-ollama') so it can be renamed without a code change. It MUST match the\n// gateway's OLLAMA_PROVIDER_NAME env (the gateway keys its Ollama routing +\n// OLLAMA_API_KEY off the same value); read once here at module load.\nconst OLLAMA_PROVIDER = process.env.OLLAMA_PROVIDER_NAME?.trim() || 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed DIRECT to DeepSeek's own API via its Anthropic-compatible\n // endpoint (provider 'deepseek'). The gateway's built-in default for this\n // provider is Auth:x-api-key + Endpoint:anthropic (see knownProviderDefaults in\n // rayu-gateway/internal/config/config.go), so handleAnthropicMessages forwards\n // to https://api.deepseek.com/anthropic/v1/messages keyed by the gateway's\n // DEEPSEEK_API_KEY. This is the NATIVE rayu-hosted path — the CLI talks the\n // Anthropic SDK to the gateway's /anthropic base (see rayuHostedClient.ts), so\n // thinking / tools / prompt-cache usage map 1:1 with no OpenAI translation.\n // upstreamModelId is DeepSeek's own model id (NOT an Ollama `:cloud` tag):\n // deepseek-v4-pro → deepseek-v4-pro\n // deepseek-v4-flash → deepseek-v4-flash\n // NOTE: for this to route, 'deepseek' must NOT be in RAYU_DISABLED_PROVIDERS\n // and DEEPSEEK_API_KEY must be set in the gateway env.\n // input==output price → FLAT billing, so creditMultiplier is exactly credits\n // per 1M tokens (pro = 1.0 → 1 credit/1M; flash = 0.33). The CLI resolves the\n // deepseek-v4 codes to 1M context — add a per-model override if the real\n // model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com',\n upstreamModelId: 'deepseek-v4-flash', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat 0.33 credits / 1M tokens\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com',\n upstreamModelId: 'deepseek-v4-pro', // DeepSeek API model id (Anthropic-compatible)\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat, exactly 1 credit / 1M tokens\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 Code (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n // Ollama's real id is 'kimi-k2.7-code' (NOT 'kimi-k2.7:cloud' — that 404s).\n // Verified against ollama.com/api/tags. NOTE: this model is subscription-gated\n // on Ollama (403 \"requires a subscription\") until the account's plan includes it.\n upstreamModelId: 'kimi-k2.7-code',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "2fae27b0f561997f7fb5919ec09dc6f8ca11478d": {"t": 1785754696.8194618, "n": 7862, "h": "424b4920af232775", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// Ollama Cloud's provider name is configurable via OLLAMA_PROVIDER_NAME (default\n// 'rayu-ollama') so it can be renamed without a code change. It MUST match the\n// gateway's OLLAMA_PROVIDER_NAME env (the gateway keys its Ollama routing +\n// OLLAMA_API_KEY off the same value); read once here at module load.\nconst OLLAMA_PROVIDER = process.env.OLLAMA_PROVIDER_NAME?.trim() || 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed through OLLAMA CLOUD (provider OLLAMA_PROVIDER, Rayu's\n // OLLAMA_API_KEY) — the official DeepSeek provider is DISABLED/dropped. The\n // upstreamModelId is the EXACT Ollama Cloud tag (`ollama run <id>`):\n // deepseek-v4-pro → deepseek-v4-pro:cloud\n // deepseek-v4-flash → deepseek-v4-flash:cloud\n // input==output price → FLAT billing, so creditMultiplier is exactly credits\n // per 1M tokens (pro = 1.0 → 1 credit/1M; flash = 0.33). The CLI resolves the\n // deepseek-v4 codes to 1M context — add a per-model override if the Ollama\n // model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v4-flash:cloud', // Ollama Cloud tag\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat 0.33 credits / 1M tokens\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v4-pro:cloud', // Ollama Cloud tag\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat, exactly 1 credit / 1M tokens\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 Code (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n // Ollama's real id is 'kimi-k2.7-code' (NOT 'kimi-k2.7:cloud' — that 404s).\n // Verified against ollama.com/api/tags. NOTE: this model is subscription-gated\n // on Ollama (403 \"requires a subscription\") until the account's plan includes it.\n upstreamModelId: 'kimi-k2.7-code',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "8e6898484890bf5cc6d7fb499042f3e27000a2d7": {"t": 1785754702.3661318, "n": 7836, "h": "ecc0c69d8035d524", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// Ollama Cloud's provider name is configurable via OLLAMA_PROVIDER_NAME (default\n// 'rayu-ollama') so it can be renamed without a code change. It MUST match the\n// gateway's OLLAMA_PROVIDER_NAME env (the gateway keys its Ollama routing +\n// OLLAMA_API_KEY off the same value); read once here at module load.\nconst OLLAMA_PROVIDER = process.env.OLLAMA_PROVIDER_NAME?.trim() || 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed through OLLAMA CLOUD (provider OLLAMA_PROVIDER, Rayu's\n // OLLAMA_API_KEY) — the official DeepSeek route is dropped. input==output price\n // → FLAT billing, so creditMultiplier is exactly credits per 1M tokens\n // (pro = 1.0 → 1 credit/1M; flash = 0.33). NOTE: set upstreamModelId to the\n // EXACT deepseek id in your Ollama account (Ollama serves deepseek as e.g.\n // deepseek-v3.1:671b-cloud). The CLI resolves the deepseek-v4 codes to 1M\n // context — add a per-model override if the Ollama model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v3.1:671b-cloud', // verify/set exact Ollama id\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat 0.33 credits / 1M tokens\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v3.1:671b-cloud', // verify/set exact Ollama id\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40, // input==output → flat, exactly 1 credit / 1M tokens\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 Code (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n // Ollama's real id is 'kimi-k2.7-code' (NOT 'kimi-k2.7:cloud' — that 404s).\n // Verified against ollama.com/api/tags. NOTE: this model is subscription-gated\n // on Ollama (403 \"requires a subscription\") until the account's plan includes it.\n upstreamModelId: 'kimi-k2.7-code',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "51221478230df27bb07700b8d7b9456e022d3bf4": {"t": 1785754703.7486646, "n": 7480, "h": "b54d8d13ca82c111", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// Ollama Cloud's provider name is configurable via OLLAMA_PROVIDER_NAME (default\n// 'rayu-ollama') so it can be renamed without a code change. It MUST match the\n// gateway's OLLAMA_PROVIDER_NAME env (the gateway keys its Ollama routing +\n// OLLAMA_API_KEY off the same value); read once here at module load.\nconst OLLAMA_PROVIDER = process.env.OLLAMA_PROVIDER_NAME?.trim() || 'rayu-ollama'\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n // DeepSeek V4 routed through OLLAMA CLOUD (provider OLLAMA_PROVIDER, Rayu's\n // OLLAMA_API_KEY) — the official DeepSeek route is dropped. ONLY the routing\n // changed; prices/multipliers are the prior admin-editable defaults (tune for\n // Ollama's real cost in the dashboard). NOTE: set upstreamModelId to the EXACT\n // deepseek id in your Ollama account (Ollama serves deepseek as e.g.\n // deepseek-v3.1:671b-cloud). The CLI resolves the deepseek-v4 codes to 1M\n // context — add a per-model override if the Ollama model's window is smaller.\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v3.1:671b-cloud', // verify/set exact Ollama id\n inputPricePer1MCents: 14,\n outputPricePer1MCents: 28,\n creditMultiplier: 0.33, // cheaper tier — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'deepseek-v3.1:671b-cloud', // verify/set exact Ollama id\n inputPricePer1MCents: 174,\n outputPricePer1MCents: 348,\n creditMultiplier: 1, // reference tier (1 credit / 1M tokens at baseline)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider = OLLAMA_PROVIDER, default 'rayu-ollama') -------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'kimi-k2.7:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: OLLAMA_PROVIDER,\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "e76461b828d1a301a30d8a4c2d9afeea946a996e": {"t": 1785754705.0895526, "n": 6515, "h": "9f41f882bb385f45", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 0.33, // cheaper model — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 1, // reference model (1 credit = 1e6/baselineCreditsPer1M tokens)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider 'rayu-ollama') ---------------------------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'kimi-k2.7:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: 'rayu-ollama',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "4e1f5068245d82111a1971373cc0b5f9c9869339": {"t": 1785754706.5963821, "n": 6563, "h": "3a829d68713d3314", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 0.33, // cheaper model — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 1, // reference model (1 credit = 1e6/baselineCreditsPer1M tokens)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n\n // --- Ollama Cloud (provider 'rayu-ollama-cloud') ---------------------------\n // Ollama's HOSTED models (ollama.com), resold via the gateway with Rayu's own\n // OLLAMA_API_KEY. They speak Ollama's NATIVE Anthropic Messages API — but at\n // `{host}/v1/messages` (NO /anthropic path segment, unlike DeepSeek/LongCat)\n // with `Authorization: Bearer` — both handled per-provider in the gateway\n // (anthropicUpstream + anthropicUsesBearerAuth). Ollama does NOT do prompt\n // caching, so every prompt token bills at the input rate.\n //\n // creditMultiplier is the USER-FACING charge = CREDITS PER 1M TOKENS (baseline\n // is 1 credit / 1M tokens): 2.5 → 2.5 credits/1M, 0.75 → 0.75 credits/1M, etc.\n // input==output price keeps the charge FLAT (output tokens bill at the same\n // rate as input), matching the spec (\"1M tokens = N credits\"). Prices here are\n // internal cost-ledger placeholders (advisory) and, like every field, are\n // admin-editable in the dashboard — nothing is hardcoded downstream.\n //\n // NOTE: upstreamModelId must match the EXACT id in the Rayu Ollama Cloud\n // account (verify with `ollama list` / the Ollama dashboard); adjust per model\n // in the admin panel if a tag differs. Llama-4 and MiniMax-M3 credit rates were\n // not specified — defaulted (1.0 / 2.5) and are admin-tunable.\n {\n code: 'glm-5.2',\n label: 'GLM-5.2 (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'glm-5.2:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'kimi-k2.7',\n label: 'Kimi K2.7 (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'kimi-k2.7:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // 2.5 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'minimax-m3',\n label: 'MiniMax M3 (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'minimax-m3:cloud',\n inputPricePer1MCents: 60,\n outputPricePer1MCents: 60,\n creditMultiplier: 2.5, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'llama-4',\n label: 'Llama 4 (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'llama4:cloud',\n inputPricePer1MCents: 40,\n outputPricePer1MCents: 40,\n creditMultiplier: 1, // default (rate unspecified) — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'gpt-oss-120b',\n label: 'GPT-OSS 120B (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'gpt-oss:120b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-397b',\n label: 'Qwen3.5 397B (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:397b-cloud',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'qwen3.5-122b',\n label: 'Qwen3.5 122B (Ollama Cloud)',\n provider: 'rayu-ollama-cloud',\n upstreamBaseUrl: 'https://ollama.com',\n upstreamModelId: 'qwen3.5:122b',\n inputPricePer1MCents: 30,\n outputPricePer1MCents: 30,\n creditMultiplier: 0.75, // 0.75 credits / 1M tokens\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "dabb71d7ff1e4bd2504de29c3fd50b5fa01bd4fa": {"t": 1785754708.8189723, "n": 2569, "h": "ed89bfb2777d4057", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 0.33, // cheaper model — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 1, // reference model (1 credit = 1e6/baselineCreditsPer1M tokens)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n // LongCat 2.0 (Meituan) — 1M-context, Anthropic-compatible API at\n // https://api.longcat.chat/anthropic/v1/messages (auth: Authorization:\n // Bearer, handled per-provider in the gateway). Real provider pricing:\n // uncached input $0.75/1M, cached input $0.015/1M (≈0.02× input), output\n // $2.95/1M. creditMultiplier is the USER-FACING credit charge and is only a\n // sensible starting default here — the admin tunes it (and every price) in\n // the dashboard; nothing about the charge is hardcoded downstream.\n code: 'longcat-2',\n label: 'LongCat 2.0',\n provider: 'longcat',\n upstreamBaseUrl: 'https://api.longcat.chat',\n upstreamModelId: 'LongCat-2.0',\n inputPricePer1MCents: 75, // $0.75 / 1M (uncached input)\n outputPricePer1MCents: 295, // $2.95 / 1M\n cacheReadCreditMultiplier: 0.02, // cached $0.015 / uncached $0.75 ≈ 0.02\n creditMultiplier: 0.5, // starting default — admin-tunable\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "72ac5f58c44c3c6b970447d63e5c1f3cb9117e46": {"t": 1785754709.963612, "n": 1550, "h": "e7863ea405bd4a02", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n cacheReadCreditMultiplier?: number\n cacheWriteCreditMultiplier?: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 0.33, // cheaper model — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 1, // reference model (1 credit = 1e6/baselineCreditsPer1M tokens)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "c61c6ddc5e3359a9f42e0808685b525d125784d7": {"t": 1785754711.375495, "n": 1475, "h": "767aec87c5d335ba", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 0.33, // cheaper model — ~1/3 the credit cost of Pro\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 1, // reference model (1 credit = 1e6/baselineCreditsPer1M tokens)\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}, "d6ae938492fecea149595f05dd13d82ddd993932": {"t": 1785754713.0222273, "n": 1361, "h": "0a998228135c84dd", "c": "import type { PlanCode } from '../common/enums'\n\nexport interface HostedModelSeed {\n code: string\n label: string\n provider: string\n upstreamBaseUrl: string\n upstreamModelId: string\n inputPricePer1MCents: number\n outputPricePer1MCents: number\n creditMultiplier: number\n allowedPlanCodes: PlanCode[]\n enabled: boolean\n}\n\n// First-time defaults only. Prices/multipliers/access are all admin-editable in\n// the dashboard afterwards; the seed is non-destructive (create-if-missing).\n// Rayu resells these via the (Phase 2) gateway using its own purchased keys.\nexport const MODEL_SEED: HostedModelSeed[] = [\n {\n code: 'deepseek-v4-flash',\n label: 'DeepSeek V4 Flash',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-flash',\n inputPricePer1MCents: 14, // $0.14 / 1M\n outputPricePer1MCents: 28, // $0.28 / 1M\n creditMultiplier: 1,\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n {\n code: 'deepseek-v4-pro',\n label: 'DeepSeek V4 Pro',\n provider: 'deepseek',\n upstreamBaseUrl: 'https://api.deepseek.com/v1',\n upstreamModelId: 'deepseek-v4-pro',\n inputPricePer1MCents: 174, // $1.74 / 1M\n outputPricePer1MCents: 348, // $3.48 / 1M\n creditMultiplier: 3,\n allowedPlanCodes: ['pro', 'pro_plus', 'max'],\n enabled: true,\n },\n]\n"}}}}