Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(x-content): add Groq gpt-oss-120b as a funded text rung so drafting survives the paid-model outage

nirholasb8f290898c8d
diff --git a/api/_lib/x-content/editor.js b/api/_lib/x-content/editor.js
index dadd59134..1c36c3db7 100644
--- a/api/_lib/x-content/editor.js
+++ b/api/_lib/x-content/editor.js
@@ -13,8 +13,8 @@
// account's best-performing posts. It returns a verdict, scores, specific
// issues with fixes, and a rewrite. It never edits the queue: a human decides.
//
-// The transport chain it runs on (Vertex, OpenRouter, OpenAI, NVIDIA NIM) is
-// shared with the drafter and lives in llm.js.
+// The transport chain it runs on (Vertex, Groq, OpenRouter, OpenAI, NVIDIA NIM)
+// is shared with the drafter and lives in llm.js.
import { existsSync, readFileSync } from 'node:fs';
import { resolve } from 'node:path';
diff --git a/api/_lib/x-content/llm.js b/api/_lib/x-content/llm.js
index 73da642a1..bc39bcfa2 100644
--- a/api/_lib/x-content/llm.js
+++ b/api/_lib/x-content/llm.js
@@ -2,12 +2,20 @@
// brief, and reviewing one before it ships.
//
// Order is cost and quality, strongest first: Claude on Vertex AI (Google
-// credits, the standing approval in the operating rules), Claude through
-// OpenRouter, OpenAI, then Kimi K3 on NVIDIA NIM (free, multimodal, slow). A
-// rung with no credentials is skipped; a rung that errors, or that answers with
-// something the caller cannot parse, falls through to the next one. Falling
-// through on a parse failure is deliberate: a model that returns prose where
-// JSON was asked for has failed the call, and the next rung usually will not.
+// credits, the standing approval in the operating rules), gpt-oss-120b on Groq
+// (funded, fast, text-only), Claude through OpenRouter, OpenAI, then Kimi K3 on
+// NVIDIA NIM (free, multimodal, slow). A rung with no credentials is skipped; a
+// rung that errors, or that answers with something the caller cannot parse,
+// falls through to the next one. Falling through on a parse failure is
+// deliberate: a model that returns prose where JSON was asked for has failed the
+// call, and the next rung usually will not.
+//
+// The Groq rung is text-only: it skips any request that carries an image, so a
+// review that must see its media never gets an image-blind verdict from it and
+// falls to a multimodal rung (Vertex or NVIDIA) instead. It still serves the
+// drafting job, whose brief is text, which is why it sits high: when the paid
+// multimodal rungs are unfunded, drafting stays fast and reliable on it while
+// review still routes to NVIDIA.
export const EDITOR_MODEL = 'claude-opus-5';
@@ -21,8 +29,9 @@ async function viaVertex({ system, parts }) {
return { model: `vertex:${EDITOR_MODEL}`, text: body.content.filter((block) => block.type === 'text').map((block) => block.text).join('') };
}
-async function viaChatCompletions({ system, parts }, { url, key, model, label, extraHeaders = {} }) {
+async function viaChatCompletions({ system, parts }, { url, key, model, label, extraHeaders = {}, textOnly = false }) {
if (!key) return null;
+ if (textOnly && parts.some((part) => part.type === 'image')) return null;
const content = parts.map((part) => (part.type === 'image' ? { type: 'image_url', image_url: { url: `data:${part.mime};base64,${part.data}` } } : { type: 'text', text: part.text }));
const response = await fetch(url, {
method: 'POST',
@@ -38,6 +47,7 @@ async function viaChatCompletions({ system, parts }, { url, key, model, label, e
export function modelRungs(request, env = process.env) {
return [
() => viaVertex(request),
+ () => viaChatCompletions(request, { url: 'https://api.groq.com/openai/v1/chat/completions', key: env.GROQ_API_KEY, model: 'openai/gpt-oss-120b', label: 'groq', textOnly: true }),
() => viaChatCompletions(request, { url: 'https://openrouter.ai/api/v1/chat/completions', key: env.OPENROUTER_API_KEY, model: `anthropic/${EDITOR_MODEL}`, label: 'openrouter', extraHeaders: { 'http-referer': 'https://three.ws', 'x-title': 'three.ws editorial review' } }),
() => viaChatCompletions(request, { url: 'https://api.openai.com/v1/chat/completions', key: env.OPENAI_API_KEY, model: 'gpt-5.5-pro', label: 'openai' }),
() => viaChatCompletions(request, { url: 'https://integrate.api.nvidia.com/v1/chat/completions', key: env.NVIDIA_API_KEY, model: 'moonshotai/kimi-k3', label: 'nvidia' }),
diff --git a/docs/x-content-pipeline.md b/docs/x-content-pipeline.md
index 95bb5320b..3e59ad0e3 100644
--- a/docs/x-content-pipeline.md
+++ b/docs/x-content-pipeline.md
@@ -51,7 +51,7 @@ X Articles require the posting account to be on X Premium.
| `data/x-content/articles/<id>.md` | Article bodies, in Markdown. |
| `public/x-media/<id>/` | Media for queue items. Media must live under `public/` or `data/` so it ships inside the production image. |
| [api/_lib/x-content/](../api/_lib/x-content/) | The engine: voice and editorial lint, media rules, live fact verification, the AI editor, review records, Markdown to Article conversion, scheduler, publisher, ledger. |
-| [api/_lib/x-content/llm.js](../api/_lib/x-content/llm.js) | The model chain (Vertex, OpenRouter, OpenAI, NVIDIA NIM) the editor and the announcement drafter share. |
+| [api/_lib/x-content/llm.js](../api/_lib/x-content/llm.js) | The model chain (Vertex, Groq gpt-oss-120b, OpenRouter, OpenAI, NVIDIA NIM) the editor and the announcement drafter share. |
| [api/_lib/announce/](../api/_lib/announce/) | The [announcement factory](./announcement-factory.md): it fills this queue from the backlog of shipped surfaces nobody has posted about. |
| `data/x-content/reviews/<id>.json` | The editorial review record for each item, bound to a hash of the exact content that was reviewed. |
| [api/cron/x-content.js](../api/cron/x-content.js) | The Cloud Scheduler tick, every 15 minutes. |
@@ -194,7 +194,7 @@ Feature probes, in `probes`, run as part of every review, and the `api` ones run
The live product is the source of truth. When a screenshot disagrees with the live page, the screenshot is stale: recapture it and use the live number. The editor is instructed the same way, and its verdict cannot pass an item it raised a blocking issue on or scored below 4 anywhere. Where a human disagrees with a `revise` verdict that has no blocking issue, `"editorOverride": { "reason": "..." }` on the item records the decision; nothing overrides a failed fact check or blocking lint.
-The editor tries Claude on Vertex AI first, then Claude through OpenRouter, then OpenAI, then Kimi K3 on NVIDIA NIM, falling through on any provider or billing error; each record names the model that reviewed it. The CLI reads missing credentials from the Cloud Run service and uses the signed-in `gh` session for GitHub checks.
+The editor tries Claude on Vertex AI first, then gpt-oss-120b on Groq (skipped when the request carries an image, so a review that must see its media routes to a multimodal rung), then Claude through OpenRouter, then OpenAI, then Kimi K3 on NVIDIA NIM, falling through on any provider or billing error; each record names the model that reviewed it. The CLI reads missing credentials from the Cloud Run service and uses the signed-in `gh` session for GitHub checks.
This bar caught real errors in the first three queued posts. The Rig Doctor post said the tool knew 11 rig conventions while the live page and code said 15, called a merged fix "an open first issue" when no such issue was open, and shipped a screenshot from before the change. The AWS post was 94 characters and stated no mechanism, and an AI rewrite of it upgraded "an AWS Partner" to "a verified AWS Partner", which no evidence supports.