From a39336f7ed64b0e6aeff2a10929875151d5071a9 Mon Sep 17 00:00:00 2001 From: Prad Nukala Date: Wed, 30 Sep 2026 15:32:05 -0400 Subject: [PATCH] refactor(ask): replace hardcoded model with ASK_MODEL env variable --- apps/api/src/ask.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/api/src/ask.ts b/apps/api/src/ask.ts index d1889a4..8ef8fb4 100644 --- a/apps/api/src/ask.ts +++ b/apps/api/src/ask.ts @@ -25,12 +25,11 @@ * * The model call is OpenRouter's OpenAI-compatible chat endpoint over plain * `fetch` (no SDK — see the repo's near-zero-dependency rule), streamed, with - * `reasoning.effort: "none"`; its SSE deltas are re-emitted as bare text. The + * `reasoning.effort: "none"`, for the model the `ASK_MODEL` var names (a + * wrangler.jsonc change swaps it); its SSE deltas are re-emitted as bare text. The * reader closing the panel aborts the request, which aborts the model call. */ -const MODEL = "qwen/qwen3.8-27b:free"; - const BODY_LIMIT = 64 * 1024; const MAX_MESSAGES = 40; const MAX_CHARS = 24_000; @@ -273,7 +272,7 @@ export async function handleAsk(request: Request, env: Env): Promise { "content-type": "application/json", }, body: JSON.stringify({ - model: MODEL, + model: env.ASK_MODEL, stream: true, reasoning: { effort: "none" }, messages: [{ role: "system", content: system }, ...messages],