labs/aicharts: fast model for specs #39

Merged
teahubxyz merged 1 commits from labs/aicharts-model into main 2026-10-13 14:01:34 +00:00
2 changed files with 2 additions and 2 deletions

No files matched your search

+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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)) {