From 3086cb52ff79e31b8980287bc3494a9952cc4356 Mon Sep 17 00:00:00 2001 From: teahubxyz Date: Tue, 13 Oct 2026 07:01:33 -0700 Subject: [PATCH] labs/aicharts: fast non-thinking model for specs (#39) Live: gemma-4 took 70s+ and returned empty content on harder prompts (budget spent thinking). Llama 3.3 70B fp8-fast answers the spec directly; still overridable. Claude-Session: https://claude.ai/code/session_01VDkN7ukK1kXkqov8FaZxva Co-authored-by: Claude --- .github/time/labs/aicharts/deploy.py | 2 +- .github/time/labs/aicharts/worker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/time/labs/aicharts/deploy.py b/.github/time/labs/aicharts/deploy.py index 15e32bb..15ec08b 100644 --- a/.github/time/labs/aicharts/deploy.py +++ b/.github/time/labs/aicharts/deploy.py @@ -34,7 +34,7 @@ def deploy() -> dict: sys.exit("CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID are needed") code = parts() rev = hashlib.sha256(b"".join(d for _, _, d in code)).hexdigest()[:12] - vars_ = {"REV": rev, "AI_MODEL": cf.env("AICHARTS_AI_MODEL", cf.AI_MODEL), "AI_DAILY": cf.env("AICHARTS_AI_DAILY", "300"), + vars_ = {"REV": rev, "AI_MODEL": cf.env("AICHARTS_AI_MODEL", "@cf/meta/llama-3.3-70b-instruct-fp8-fast"), "AI_DAILY": cf.env("AICHARTS_AI_DAILY", "300"), "SAVE_DAILY": cf.env("AICHARTS_SAVE_DAILY", "1000")} db = cf.database("aicharts") # named time-aicharts, like the script meta = {"main_module": "main.js", "compatibility_date": cf.COMPAT, diff --git a/.github/time/labs/aicharts/worker.js b/.github/time/labs/aicharts/worker.js index 97106e2..a1e6cca 100644 --- a/.github/time/labs/aicharts/worker.js +++ b/.github/time/labs/aicharts/worker.js @@ -162,7 +162,7 @@ export function normalizeSpec(spec) { // Plain prompt first: the prompt's grammar and example steer small models better than a constrained decoder does (a // one-size schema for every step made them drop agg and by). JSON mode only when no object came back at all. async function model(env, messages) { - const input = { messages, max_tokens: 700, temperature: 0.1 }; + const input = { messages, max_tokens: 900, temperature: 0.1 }; const text = (out) => out?.response ?? out?.choices?.[0]?.message?.content ?? ""; let raw = text(await env.AI.run(env.AI_MODEL, input)); if (!firstObject(raw)) {