mirror of
https://github.com/bitbaum/ai-forms.git
synced 2026-12-04 08:38:53 +01:00
`CompleteFn` is deliberately bring-your-own-provider, which makes this example the file people copy — and a copied mistake is the expensive kind. A fleet-wide audit (2026-09-06) found this example teaching all three of the defects it then found in production clients. DEAD BY DEFAULT. The default model was `llama-3.3-70b-versatile`, which Groq retired with the rest of the llama-3 family. Verified live 2026-09-07: 404 model_not_found. Anyone who followed the README with a Groq key got a broken example and no way to tell why — and the same id sat in .env.example, on the line a reader is most likely to uncomment. It is a LIST now, tried in order, because that is the only shape that survives a vendor's release notes. AI_FORMS_MODEL still wins, and may itself be comma-separated. AN EMPTY HTTP 200 WAS AN ANSWER. `content ?? ''` returned the empty string as though the model had spoken. Some models return exactly that after spending their whole budget on hidden reasoning, and here it becomes "the assistant filled in nothing" with no error to explain it. Now a failure that moves to the next model. NO DEADLINE. A provider that accepted the connection and then went quiet held the form open forever, and the next model was never reached. Each attempt now gets its OWN deadline — a shared one is spent by the first model and leaves the rest with an already-expired signal, which is worse than none. Failures now name every model tried, not just the last: "the key is dead" and "one id rotted" used to read identically. Still dependency-free, on purpose — the example exists to show what CompleteFn is. It points at @bitbaum/ai-kit's complete() for anyone who would rather not hand-roll this, but being dependency-free is not a licence to demonstrate the wrong thing. verify green; the example app typechecks. Claude-Session: https://claude.ai/code/session_01NHDLTKGirKU7He8q2YR2y4 Co-authored-by: Claude Opus 5 <noreply@anthropic.com>