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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
fix(forge): hosted TRELLIS preview is text-only — route photo drafts to the standing engine
nirholasc4c4ca690c94
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex a053fb005..102a3adc3 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,7 +15,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Built-in AI stays up when a provider runs dry** — The platform's built-in AI (chat, the Brain model workbench, embedded site widgets, tutor, fact-checker, persona tools, agent talk, the transaction explainer) now runs on a deeper safety net. Three independent free lanes — Groq, OpenRouter (with automatic rotation across multiple accounts when one runs out of credits or hits a rate limit), and NVIDIA-hosted models — always serve first, and if every one of them fails, the request quietly falls through to a paid backstop instead of showing you an error. Paid x402 endpoints that previously returned errors during a provider outage now degrade the same way. Agent memory search now runs on a free embeddings lane with the paid provider demoted to backup, and embedded agents configured for a paid model degrade to the free lanes instead of erroring when that provider's key is dead. `[improvement, infra]`- **Embedded avatar chat replies again** — Avatars embedded straight from their public profile — the one-line widget on the homepage and anywhere else the avatar URL is dropped in — went silent when you typed a message: the chat box accepted your text but the avatar never answered. The built-in AI now recognizes a plain public avatar and serves it the free we-pay model with the same per-avatar rate and usage limits, so embedded chat responds out of the box. `[fix]`- **Faster, quieter agents directory and site-wide page polish** — The on-chain agents directory now loads from our server-side index instead of contacting every agent's metadata host from your browser — pages render faster and no longer spray network errors. Also: the pump.fun cockpit's sidebar pages are now shareable deep links, mobile nav and footer links meet touch-target guidelines, anonymous visitors no longer trigger failed sign-in requests on Walk and Create, and assorted dead links were removed. (`/agents`) `[improvement, fix]`-- **Free 3D drafts on Forge** — Draft generations on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — type a prompt or drop in a photo and your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Every existing engine (TRELLIS on Replicate, Meshy, Tripo) remains selectable at every quality tier, and deployments without the free lane configured keep their current behavior unchanged. (`/forge`) `[feature, improvement]`+- **Free 3D drafts on Forge** — Draft generations from a text prompt on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Photo-to-3D keeps its proven engine (the free lane is prompt-only by design), and every existing engine — TRELLIS on Replicate, Meshy, Tripo — remains selectable at every quality tier. (`/forge`) `[feature, improvement]`- **Hardened the explore feed and marketplace pricing against bad requests** — The explore discovery feed and marketplace asset-pricing lookup now reject malformed query parameters with a clear 400 instead of failing with a server error. A non-numeric page size on explore, or a malformed asset id on a price lookup, no longer surfaces a 500 — the endpoints validate input up front and respond cleanly. (`/explore`) `[fix]`- **Live $THREE market data, longer trade streams, and tutor session fixes** — $THREE market stats (price, holders, liquidity) are flowing again from our primary data source — a missing request header had been silently failing it to backups for days. Live trade streams no longer cut out after 30 seconds; they now run their full duration. The Pay-As-You-Learn Tutor no longer errors when resuming a session — running tabs persist correctly across questions — and Fact Checker results are cached properly so repeat checks of the same claim return instantly. `[fix, improvement]`- **MetaMask Agent Wallet skills for every agent** — Two new skills in the marketplace under the new Wallet category: MetaMask Agent Wallet and MetaMask Agent Workflows. Install them on any agent to let it check balances, transfer tokens, swap, bridge across chains, trade perps and prediction markets, and manage Aave positions through MetaMask's mm CLI — each user signs in with their own MetaMask Agent Wallet, so keys stay with you, never with three.ws. Platform chat agents pick the skills up automatically. (`/skills`) `[feature]`diff --git a/api/_lib/forge-tiers.js b/api/_lib/forge-tiers.jsindex 64fdccc30..c642d769b 100644--- a/api/_lib/forge-tiers.js+++ b/api/_lib/forge-tiers.js@@ -101,6 +101,11 @@ export const BACKENDS = Object.freeze({provider: 'nvidia',requiresEnv: Object.freeze(['NVIDIA_API_KEY']),polyControl: false,+ // NVIDIA's hosted TRELLIS preview only generates from text prompts — it+ // rejects every user-image input form (verified live 2026-06-11; see+ // tasks/nvidia-nim/probes/trellis.md). Photo submissions therefore route to+ // the standing image backend; this flag drives that routing and the catalog.+ userImages: false,// Grounded in the live T0.2 probe (tasks/nvidia-nim/probes/trellis.md): draft// text→3D returned synchronously in ~13 s end-to-end incl. R2 persist. With the// draft tier's 0.6 multiplier, baseEta 22 ≈ that observed wall-clock; NVCF keeps@@ -110,7 +115,7 @@ export const BACKENDS = Object.freeze({// Free NVIDIA NIM lane — no vendor credit cost. This is what makes it the// free-first draft default per platform policy.free: true,- blurb: 'Free TRELLIS reconstruction on NVIDIA NIM. The default draft lane; no vendor cost.',+ blurb: 'Free TRELLIS generation on NVIDIA NIM — the default draft lane for prompts; no vendor cost. Photo input uses the standing engine.',}),trellis: Object.freeze({id: 'trellis',@@ -192,24 +197,36 @@ export const FREE_DEFAULT_FOR_DRAFT = Object.freeze({});// Resolve the default backend for a (path, tier) when the caller didn't name-// one. Tier matters because the draft tier routes to the free lane first.-function defaultBackendFor(p, tierId) {+// one. Tier matters because the draft tier routes to the free lane first;+// `userImages` matters because a free lane that can't take user photos+// (BACKENDS[id].userImages === false) must not be defaulted for them.+function defaultBackendFor(p, tierId, userImages) {if (tierId === 'draft') {const free = FREE_DEFAULT_FOR_DRAFT[p];- if (free && BACKENDS[free] && BACKENDS[free].paths.includes(p) && backendIsConfigured(free)) {+ const b = free && BACKENDS[free];+ if (+ b &&+ b.paths.includes(p) &&+ backendIsConfigured(free) &&+ (!userImages || b.userImages !== false)+ ) {return free;}}return DEFAULT_BACKEND_FOR_PATH[p];}-export function resolveBackendId({ path, tier, backend }) {+// `userImages: true` = the request carries caller-supplied reference images, so+// the resolved default must be a backend that accepts them. An explicitly named+// backend is always honored here — the forge handler rejects an unsupported+// (backend, input) combination with a designed error at the boundary instead.+export function resolveBackendId({ path, tier, backend, userImages = false }) {const p = PATHS.includes(path) ? path : DEFAULT_PATH;if (backend && BACKENDS[backend] && BACKENDS[backend].paths.includes(p)) {return backend;}const tierId = tier?.id || tier || DEFAULT_TIER;- return defaultBackendFor(p, tierId);+ return defaultBackendFor(p, tierId, userImages);}function readEnv(name) {@@ -287,6 +304,9 @@ export function buildCatalog() {byok: b.byok || null,poly_control: b.polyControl,free: Boolean(b.free),+ // False when the backend generates from text prompts only (NVIDIA's+ // hosted TRELLIS preview) — the UI must not offer it for photo input.+ user_images: b.userImages !== false,configured: backendIsConfigured(b.id),blurb: b.blurb,estimates: b.paths.reduce((acc, p) => {diff --git a/api/_providers/nvidia.js b/api/_providers/nvidia.jsindex d783bd364..29e4f9e2d 100644--- a/api/_providers/nvidia.js+++ b/api/_providers/nvidia.js@@ -1,21 +1,30 @@-// NVIDIA NIM provider — the FREE TRELLIS 3D-generation backend.+// NVIDIA NIM provider — the FREE TRELLIS 3D-generation backend (TEXT-ONLY).//// Microsoft TRELLIS hosted on NVIDIA NVCF gives `/forge` a zero-vendor-cost-// text→3D and image→3D lane (GLB output) behind the platform `NVIDIA_API_KEY`.-// Per the platform free-first policy it is the default draft backend, with the-// paid Replicate/Meshy/Tripo lanes staying selectable as backstops.+// text→3D lane (GLB output) behind the platform `NVIDIA_API_KEY`. Per the+// platform free-first policy it is the default draft backend for prompt+// generations, with the paid Replicate/Meshy/Tripo lanes staying selectable.//-// ── Protocol (NVCF invoke → 202 → poll → base64 GLB) ────────────────────────-// Built against the researched NVCF contract pending the live T0.2 probe; the-// field names below are sourced from NVIDIA's own docs/clients:-// docs.api.nvidia.com/nim/reference/microsoft-trellis-// docs.nvidia.com/nim/visual-genai/1.3.2/getting-started.html-// github.com/NVIDIA-AI-Blueprints/Retail-Catalog-Enrichment (trellis.py)+// ── Why text-only ────────────────────────────────────────────────────────────+// The hosted preview API does NOT accept user images for mode:"image": every+// form — inline base64 at any size, NVCF asset references (`;asset_id,` with+// NVCF-INPUT-ASSET-REFERENCES), bare asset ids — is rejected 422; the only+// accepted image input is `data:image/png;example_id,{0..3}` referencing+// NVIDIA's predefined sample images. Verified live 2026-06-11 against the real+// endpoint and confirmed by the official schema docs — full transcripts in+// tasks/nvidia-nim/probes/trellis.md. Self-deployed TRELLIS NIMs accept real+// image input, so this constraint is about NVIDIA's hosted preview, not the+// model; if NVIDIA lifts it, the asset handshake recipe is preserved in the+// probe file and git history.//+// The forge layer therefore routes user-photo submissions to the standing+// image backend (Replicate TRELLIS) and only sends prompts here — see+// resolveBackendId({ userImages }) in api/_lib/forge-tiers.js.+//+// ── Protocol (verified live, T0.2/T1.1 probes) ──────────────────────────────// submit POST https://ai.api.nvidia.com/v1/genai/microsoft/trellis// Authorization: Bearer nvapi-… Accept: application/json-// text→3D { mode:"text", prompt, seed?, ss_sampling_steps, slat_sampling_steps, output_format:"GLB" }-// image→3D { mode:"image", image:"data:<ct>;base64,<…>" | "data:<ct>;asset_id,<id>", … }+// { mode:"text", prompt, seed?, ss_sampling_steps, slat_sampling_steps, output_format:"glb" }// → 202 + header NVCF-REQID (async; poll) | 200 + body (synchronous completion)//// poll GET https://api.nvcf.nvidia.com/v2/nvcf/pexec/status/{NVCF-REQID}@@ -26,10 +35,6 @@// providers (replicate/meshy return upstream URLs; TRELLIS returns the// bytes inline, so WE own the persist).//-// Images over the 180 KB inline limit go through the NVCF asset handshake-// (create asset → PUT to presigned URL → reference the asset id), exactly as-// NVIDIA's media NIMs require.-//// Error codes match the established provider contract (replicate.js / meshy.js):// provider_unreachable / invalid_key / insufficient_credits / rate_limited /// provider_error — so the forge layer can route around a dead/limited lane.@@ -38,22 +43,15 @@ import { env } from '../_lib/env.js';const TRELLIS_INVOKE_URL = 'https://ai.api.nvidia.com/v1/genai/microsoft/trellis';const NVCF_STATUS_URL = 'https://api.nvcf.nvidia.com/v2/nvcf/pexec/status';-const NVCF_ASSETS_URL = 'https://api.nvcf.nvidia.com/v2/nvcf/assets';// TRELLIS truncates the text prompt at 77 characters server-side; clamp so the// request is honest about what's actually conditioning the generation.const TRELLIS_PROMPT_MAX = 77;-// NVCF rejects an inline image whose RAW bytes exceed 180 KB; larger references-// must be uploaded via the asset handshake and passed by id.-const INLINE_IMAGE_LIMIT = 180 * 1024;-// Per-request timeouts so a hung upstream never stalls a serverless function.// A completed poll streams the full GLB (can be several MB), so it gets longer.const SUBMIT_TIMEOUT_MS = 30_000;const POLL_TIMEOUT_MS = 60_000;-const ASSET_TIMEOUT_MS = 30_000;-const IMAGE_FETCH_TIMEOUT_MS = 20_000;// Sampling steps per quality tier, clamped to TRELLIS's accepted 10–50 window.// More steps = finer geometry/texture at higher latency; draft stays cheap so@@ -111,19 +109,6 @@ function buildTextBody({ prompt, tier, seed }) {return body;}-function buildImageBody({ imageField, tier, seed }) {- const steps = trellisSteps(tier);- const body = {- mode: 'image',- image: imageField,- ss_sampling_steps: steps.ss,- slat_sampling_steps: steps.slat,- output_format: 'glb',- };- if (Number.isInteger(seed)) body.seed = seed;- return body;-}-export function createNvidiaProvider() {const apiKey = env.NVIDIA_API_KEY;if (!apiKey) {@@ -150,103 +135,6 @@ export function createNvidiaProvider() {return publicUrl(key);}- // NVCF asset handshake for reference images above the inline limit:- // 1. POST /assets { contentType, description } → { assetId, uploadUrl }- // 2. PUT the raw bytes to the presigned uploadUrl (no auth header — the URL- // is already signed; it carries the required x-amz-meta description)- // 3. caller references the asset id via the NVCF-INPUT-ASSET-REFERENCES- // header and the `data:<ct>;asset_id,<id>` image field.- async function uploadAsset(bytes, contentType) {- let createRes;- try {- createRes = await fetch(NVCF_ASSETS_URL, {- method: 'POST',- headers: invokeHeaders,- body: JSON.stringify({ contentType, description: 'trellis-input' }),- signal: AbortSignal.timeout(ASSET_TIMEOUT_MS),- });- } catch (err) {- throw Object.assign(new Error(`NVCF asset create unreachable: ${err?.message}`), {- code: 'provider_unreachable',- status: 502,- });- }- if (!createRes.ok) {- throw providerError(createRes.status, 'NVCF asset create failed', createRes.headers.get('retry-after'));- }- const created = await createRes.json().catch(() => ({}));- const assetId = created.assetId;- const uploadUrl = created.uploadUrl;- if (!assetId || !uploadUrl) {- throw Object.assign(new Error('NVCF asset create returned no upload target'), {- code: 'provider_error',- status: 502,- });- }-- let putRes;- try {- putRes = await fetch(uploadUrl, {- method: 'PUT',- headers: {- 'content-type': contentType,- 'x-amz-meta-nvcf-asset-description': 'trellis-input',- },- body: bytes,- signal: AbortSignal.timeout(ASSET_TIMEOUT_MS),- });- } catch (err) {- throw Object.assign(new Error(`NVCF asset upload unreachable: ${err?.message}`), {- code: 'provider_unreachable',- status: 502,- });- }- if (!putRes.ok) {- throw Object.assign(new Error(`NVCF asset upload returned ${putRes.status}`), {- code: 'provider_error',- status: 502,- providerStatus: putRes.status,- });- }- return assetId;- }-- // Reference images arrive as R2 https URLs. Fetch the bytes server-side, then- // inline them as a base64 data URI when small enough, or run the asset- // handshake and reference by id. Returns the `image` body field plus any- // extra invoke headers (the asset reference) the request needs.- async function prepareImageInput(imageUrl) {- let resp;- try {- resp = await fetch(imageUrl, { signal: AbortSignal.timeout(IMAGE_FETCH_TIMEOUT_MS) });- } catch (err) {- throw Object.assign(new Error(`failed to fetch reference image: ${err?.message}`), {- code: 'provider_unreachable',- status: 502,- });- }- if (!resp.ok) {- throw Object.assign(new Error(`reference image fetch returned ${resp.status}`), {- code: 'provider_error',- status: 502,- providerStatus: resp.status,- });- }- const contentType = (resp.headers.get('content-type') || 'image/png').split(';')[0].trim() || 'image/png';- const bytes = Buffer.from(await resp.arrayBuffer());- if (bytes.byteLength <= INLINE_IMAGE_LIMIT) {- return {- imageField: `data:${contentType};base64,${bytes.toString('base64')}`,- assetHeaders: {},- };- }- const assetId = await uploadAsset(bytes, contentType);- return {- imageField: `data:${contentType};asset_id,${assetId}`,- assetHeaders: { 'NVCF-INPUT-ASSET-REFERENCES': assetId },- };- }-// POST the invoke request. Returns either { done:true, glbBase64 } when the// generation completed synchronously (200) or { done:false, reqId } when NVCF// accepted it for async processing (202). Throws normalized provider errors.@@ -320,20 +208,6 @@ export function createNvidiaProvider() {return finishSubmit('text-to-3d', parsed);},- // Single-image→3D. `imageUrl` is an R2 https URL; it is fetched and either- // inlined or asset-uploaded before the invoke.- async imageTo3d({ imageUrl, tier, seed } = {}) {- if (!imageUrl) {- throw Object.assign(new Error('imageTo3d requires an imageUrl'), {- code: 'provider_error',- status: 400,- });- }- const { imageField, assetHeaders } = await prepareImageInput(imageUrl);- const parsed = await postInvoke(buildImageBody({ imageField, tier, seed }), assetHeaders);- return finishSubmit('image-to-3d', parsed);- },-// Poll an async job. Never throws — transient failures resolve to// 'running' so the forge poll loop keeps the job alive; only terminal// upstream states map to 'failed'. On 'done' the GLB is decoded, persisteddiff --git a/api/forge.js b/api/forge.jsindex 01ec4f4e3..d7c8e9c42 100644--- a/api/forge.js+++ b/api/forge.js@@ -200,7 +200,22 @@ async function startJob(req, res) {const tier = resolveTier(parseTier(body));// Tier matters to backend selection: the draft tier routes to the free NVIDIA// NIM lane first (when configured) per the platform free-first policy.- const backendId = resolveBackendId({ path, tier, backend: body?.backend });+ // `userImages` keeps photo submissions off text-only backends — NVIDIA's+ // hosted TRELLIS preview rejects every user-image input, so a defaulted photo+ // draft transparently uses the standing image engine instead.+ const backendId = resolveBackendId({ path, tier, backend: body?.backend, userImages: isImageMode });++ // An explicitly selected text-only backend can't serve a photo submission —+ // say so plainly rather than failing upstream with an opaque 422.+ if (isImageMode && BACKENDS[backendId]?.userImages === false) {+ return json(res, 422, {+ error: 'backend_text_only',+ backend: backendId,+ message:+ `${BACKENDS[backendId].label} generates from text prompts only — NVIDIA's hosted preview doesn't accept uploaded photos. ` ++ 'Drop the backend field to use the default photo engine, or pick TRELLIS, Meshy, or Tripo.',+ });+ }try {// ── Geometry-first path (Meshy / Tripo, BYOK) ───────────────────────────@@ -275,12 +290,13 @@ async function startJob(req, res) {});}- // ── Free NVIDIA NIM TRELLIS lane (platform-keyed; direct text/image→3D) ──- // TRELLIS on NIM emits the mesh natively from a prompt or a single photo- // (no FLUX intermediate view), so it exposes meshy-style text/image methods- // and a pollable NVCF request id — but it needs no BYOK key. It serves the- // image path as the free draft default. NVCF normally returns a poll- // handle; on the rare synchronous completion the GLB is already in R2.+ // ── Free NVIDIA NIM TRELLIS lane (platform-keyed; direct text→3D) ────────+ // TRELLIS on NIM emits the mesh natively from the prompt (no FLUX+ // intermediate view) and needs no BYOK key. It serves prompt submissions+ // on the image path as the free draft default; photo submissions never+ // resolve here (hosted preview is text-only — see the provider header).+ // NVCF normally returns a poll handle; on the rare synchronous completion+ // the GLB is already in R2.if (backendId === 'nvidia') {let nv;try {@@ -293,23 +309,16 @@ async function startJob(req, res) {});}- let submitted;- let previewImageUrl = null;- if (isImageMode) {- previewImageUrl = imageUrls[0];- submitted = await nv.imageTo3d({ imageUrl: previewImageUrl, tier });- } else {- submitted = await nv.textTo3d({ prompt, tier });- }+ const submitted = await nv.textTo3d({ prompt, tier });const provenance = {- mode: isImageMode ? 'image_to_3d' : 'text_to_3d',+ mode: 'text_to_3d',path,tier: tier.id,backend: backendId,prompt: prompt || null,- preview_image_url: previewImageUrl,- reference_image_urls: isImageMode ? [imageUrls[0]] : [],+ preview_image_url: null,+ reference_image_urls: [],eta_seconds: estimateEtaSeconds({ backendId, tier }),estimated_credits: estimateCredits({ backendId, path, tier }),};@@ -323,13 +332,13 @@ async function startJob(req, res) {const creationId = await createCreation({clientKey,ipHash: hashIp(ip),- prompt: prompt || (isImageMode ? 'image-to-3d' : ''),- aspect: isImageMode ? null : aspect,- previewImageUrl,+ prompt,+ aspect,+ previewImageUrl: null,replicateJobId: syntheticJob,textToImageModel: null,- viewsRequested: isImageMode ? imageUrls.length : 0,- viewsUsed: isImageMode ? 1 : null,+ viewsRequested: 0,+ viewsUsed: null,multiview: false,backend: backendId,tier: tier.id,@@ -360,13 +369,13 @@ async function startJob(req, res) {const creationId = await createCreation({clientKey,ipHash: hashIp(ip),- prompt: prompt || (isImageMode ? 'image-to-3d' : ''),- aspect: isImageMode ? null : aspect,- previewImageUrl,+ prompt,+ aspect,+ previewImageUrl: null,replicateJobId: submitted.taskId,textToImageModel: null,- viewsRequested: isImageMode ? imageUrls.length : 0,- viewsUsed: isImageMode ? 1 : null,+ viewsRequested: 0,+ viewsUsed: null,multiview: false,backend: backendId,tier: tier.id,diff --git a/data/changelog.json b/data/changelog.jsonindex 3c5cde489..1f2a41e21 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -50,7 +50,7 @@{"date": "2026-06-11","title": "Free 3D drafts on Forge",- "summary": "Draft generations on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — type a prompt or drop in a photo and your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Every existing engine (TRELLIS on Replicate, Meshy, Tripo) remains selectable at every quality tier, and deployments without the free lane configured keep their current behavior unchanged.",+ "summary": "Draft generations from a text prompt on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Photo-to-3D keeps its proven engine (the free lane is prompt-only by design), and every existing engine — TRELLIS on Replicate, Meshy, Tripo — remains selectable at every quality tier.","tags": ["feature","improvement"diff --git a/public/changelog.json b/public/changelog.jsonindex f40a674e9..9231bb4b3 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-11T11:16:55.409Z",+ "generated_at": "2026-06-11T11:23:58.189Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -104,7 +104,7 @@"date": "2026-06-11","type": "update","title": "Free 3D drafts on Forge",- "summary": "Draft generations on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — type a prompt or drop in a photo and your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Every existing engine (TRELLIS on Replicate, Meshy, Tripo) remains selectable at every quality tier, and deployments without the free lane configured keep their current behavior unchanged.",+ "summary": "Draft generations from a text prompt on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Photo-to-3D keeps its proven engine (the free lane is prompt-only by design), and every existing engine — TRELLIS on Replicate, Meshy, Tripo — remains selectable at every quality tier.","link": "/forge","tags": ["feature",diff --git a/public/changelog.xml b/public/changelog.xmlindex 62bfe16b3..5823d8b65 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -84,7 +84,7 @@<guid isPermaLink="false">2026-06-11:Free 3D drafts on Forge</guid><pubDate>Thu, 11 Jun 2026 12:00:00 GMT</pubDate><category>feature</category>- <description>Draft generations on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — type a prompt or drop in a photo and your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Every existing engine (TRELLIS on Replicate, Meshy, Tripo) remains selectable at every quality tier, and deployments without the free lane configured keep their current behavior unchanged.</description>+ <description>Draft generations from a text prompt on Forge now run on a free NVIDIA-hosted TRELLIS engine by default — your first 3D model costs nothing and arrives in about 15 seconds, several times faster than the previous default. Photo-to-3D keeps its proven engine (the free lane is prompt-only by design), and every existing engine — TRELLIS on Replicate, Meshy, Tripo — remains selectable at every quality tier.</description></item><item><title>Hardened the explore feed and marketplace pricing against bad requests</title>diff --git a/public/features.json b/public/features.jsonindex 8c7a74c82..8bb076c1a 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-06-11T11:16:55.399Z",+ "generated_at": "2026-06-11T11:23:58.173Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/src/forge.js b/src/forge.jsindex 6881e648c..35cff23a5 100644--- a/src/forge.js+++ b/src/forge.js@@ -87,6 +87,9 @@ let currentCreationId = null;let catalog = null;let selectedTier = 'standard';let selectedEngine = { id: 'trellis', path: 'image', backend: 'trellis', byok: null, polyControl: false };+// Once the user deliberately picks an engine we stop auto-selecting the+// catalog's per-tier default (e.g. the free NVIDIA lane on draft) under them.+let userPickedEngine = false;// BYOK key held only in memory for this session — sent per request, never stored// by the page. Signed-in users can instead save it server-side in Account.let providerKey = '';@@ -235,6 +238,9 @@ function buildEngineButtons() {btn.dataset.backend = b.id;btn.dataset.byok = b.byok || '';btn.dataset.poly = String(Boolean(b.poly_control));+ // Text-only engines (the free NVIDIA TRELLIS preview) can't take photos;+ // updateEngineAvailability() disables them while reference views are set.+ btn.dataset.userimages = String(b.user_images !== false);btn.textContent = ENGINE_LABELS[b.id] || b.label;btn.title = `${b.label} — ${b.blurb}`;btn.setAttribute('aria-pressed', String(b.id === selectedEngine.backend));@@ -245,6 +251,46 @@ function buildEngineButtons() {const first = els.engine.querySelector('button');if (first) selectEngine(first, true);}+ updateEngineAvailability();+}++// Keep the engine buttons honest about the current input mode, and keep the+// selection on the catalog's per-tier default until the user picks one.+// • With reference photos attached, text-only engines are disabled (the free+// NVIDIA TRELLIS preview rejects user images) and a selected one bounces to+// the default photo engine.+// • With no photos and no explicit user choice, the tier's default engine is+// applied — which is what routes draft prompts onto the free lane.+function updateEngineAvailability() {+ if (!els.engine || !catalog) return;+ const hasPhotos = slots.some((s) => s.state === 'uploaded' || s.state === 'uploading');+ let bounceTo = null;+ for (const btn of els.engine.querySelectorAll('button')) {+ const textOnly = btn.dataset.userimages === 'false';+ const blocked = textOnly && hasPhotos;+ btn.disabled = blocked;+ btn.setAttribute('aria-disabled', String(blocked));+ if (blocked) {+ btn.title = 'This engine generates from text prompts only — clear the reference views to use it.';+ } else if (catalog.backends) {+ const b = catalog.backends.find((x) => x.id === btn.dataset.backend);+ if (b) btn.title = `${b.label} — ${b.blurb}`;+ }+ if (blocked && btn.dataset.backend === selectedEngine.backend) bounceTo = true;+ }+ const defaultId = catalog.default_backend_for_tier?.[selectedTier]?.[selectedEngine.path === 'geometry' ? 'geometry' : 'image'];+ if (bounceTo) {+ // Forced move: the selected engine can't serve photos. Prefer the standing+ // photo default, else the first enabled button.+ const fallbackId = catalog.default_backend?.image || 'trellis';+ const target =+ els.engine.querySelector(`button[data-backend="${fallbackId}"]:not(:disabled)`) ||+ els.engine.querySelector('button:not(:disabled)');+ if (target) selectEngine(target);+ } else if (!userPickedEngine && !hasPhotos && defaultId && defaultId !== selectedEngine.backend) {+ const target = els.engine.querySelector(`button[data-backend="${defaultId}"]:not(:disabled)`);+ if (target) selectEngine(target);+ }}function selectEngine(btn, silent) {@@ -284,6 +330,8 @@ function selectTier(tierId) {for (const b of els.tier.querySelectorAll('button')) {b.setAttribute('aria-pressed', String(b.dataset.tier === tierId));}+ // Tier changes can move the default engine (draft prefers the free lane).+ updateEngineAvailability();updateEstimate();}@@ -405,6 +453,9 @@ function renderSlot(i) {const s = slots[i];el.dataset.state = s.state;el.draggable = s.state === 'uploaded';+ // Slot changes flip the input mode (prompt-only ↔ photo), which changes+ // which engines may serve — keep the selector honest in the same frame.+ updateEngineAvailability();const img = el.querySelector('.vs-thumb');if (s.objectUrl) {@@ -1015,7 +1066,10 @@ els.tier?.addEventListener('click', (e) => {});els.engine?.addEventListener('click', (e) => {const btn = e.target.closest('button[data-engine]');- if (btn) selectEngine(btn);+ if (btn && !btn.disabled) {+ userPickedEngine = true;+ selectEngine(btn);+ }});els.providerKey?.addEventListener('input', () => {providerKey = els.providerKey.value.trim();diff --git a/tasks/nvidia-nim/PLAN.md b/tasks/nvidia-nim/PLAN.mdindex 64dd73687..3bdae0640 100644--- a/tasks/nvidia-nim/PLAN.md+++ b/tasks/nvidia-nim/PLAN.md@@ -100,6 +100,29 @@ Status legend: `[ ]` not started · `[~]` in progress (note who/when in Worklog)## Worklog (append-only; newest at top)+- **2026-06-11** — **T1.5 prod smoke, part 1 + upstream image-mode discovery & fix.**+ Deploy `5c161886` went READY with the Phase 1 code (after 4 consecutive deploy ERRORs:+ the audit-symlink/.git failure, fixed in `cdffd38c`, then a transient `embed`-export+ mismatch in `api/watsonx/embed.js` introduced by a mid-rename sweep, fixed in+ `f1587ba9`). **Text→3D draft verified on PRODUCTION**: `POST /api/forge {prompt, tier:+ draft}` → 200 in **15.0 s**, `backend: nvidia`, synchronous done, durable R2 GLB —+ fetched + validated (glTF magic, v2, declared length 1,372,132 = actual). **Image→3D+ failed in prod** with NVCF 422 — live probing (inline base64 at 203 KB *and* 35 KB,+ `;asset_id,` with the NVCF header, `;example_id,<asset-uuid>`, bare uuid) plus the+ official schema doc proved the hosted TRELLIS preview accepts ONLY `example_id` 0–3+ sample images: **user photos are unsupported upstream** (full table appended to+ `probes/trellis.md`). Shipped the honest routing the same hour: provider is text-only+ (asset-handshake code deleted; recipe preserved in probe/history), forge-tiers gained+ `userImages` capability + `resolveBackendId({userImages})` so photo drafts default to+ the standing Replicate lane, explicit photo+nvidia gets a designed 422+ `backend_text_only`, catalog exposes `user_images`, and the /forge UI now (a)+ auto-selects the tier's default engine until the user picks one (draft prompts land on+ the free lane for real first-time visitors), (b) disables text-only engines while+ reference views are attached, bouncing a blocked selection to the photo default.+ Changelog entry corrected to "prompt drafts free" (no photo overclaim). Tests: provider+ suite re-shaped (25 green), forge-tiers +3 cases (16 green), x402-forge/replicate+ untouched green. Re-smoke of the photo flow against the new deploy is the remaining+ T1.5 leg (expect `backend: trellis` via Replicate).- **2026-06-11** — **T3.1 audit of `771c84b4` + gap closure; T3.2 re-embed script done(dry-run executed; prod run pending the T3.1 deploy).****Audit verdict:** `771c84b4` implemented free-first embeddings on a *different* surface —diff --git a/tasks/nvidia-nim/probes/trellis.md b/tasks/nvidia-nim/probes/trellis.mdindex b3a423e77..f81a507d6 100644--- a/tasks/nvidia-nim/probes/trellis.md+++ b/tasks/nvidia-nim/probes/trellis.md@@ -105,3 +105,35 @@ console.log(res.status, buf.subarray(0,4).toString("ascii"), buf.byteLength);The provider wrapper (`api/_providers/nvidia.js`) + full persist verification live in`scripts/verify-nvidia-trellis.mjs`.++---++## Addendum 2026-06-11 (T1.5 prod smoke): image mode is example-gated on the hosted preview++Live findings while smoking the deployed image→3D flow — **the hosted preview API does+not accept user images at all.** Every input form was probed against+`POST https://ai.api.nvidia.com/v1/genai/microsoft/trellis` with a valid key:++| Input form | Result |+|---|---|+| inline base64, 203 KB PNG | 422 `{"detail":"Expected: example_id, got: base64"}` |+| inline base64, 35 KB JPEG | 422 `{"detail":"Expected: example_id, got: base64"}` — size is irrelevant |+| NVCF asset (create → presigned PUT → `data:<ct>;asset_id,<id>` + `NVCF-INPUT-ASSET-REFERENCES`) | 422 `{"detail":"Expected: example_id, got: asset_id"}` |+| `data:<ct>;example_id,<real-asset-uuid>` (with and without the asset header) | 422 `{"detail":"Not valid example_id, expected value 0, 1, 2, 3"}` |+| bare asset uuid in `image` | 422 `{"detail":"Image has been provided in the invalid form"}` |++The official schema (docs.api.nvidia.com/nim/reference/microsoft-trellis-infer) confirms:+*"Preview API NIM supports only a predefined set of images. The image should be in form of+`data:image/png;example_id,{example_id}` with example_id in a range [0,3]."*++**Consequences (shipped same day):**+- `api/_providers/nvidia.js` is text-only; the NVCF asset-handshake code was removed+ (recipe preserved above and in git history — it IS the correct mechanism for+ self-deployed TRELLIS NIMs, which do accept real image input).+- `resolveBackendId({ userImages })` keeps photo submissions off text-only backends;+ explicit photo+nvidia requests get a designed 422 `backend_text_only` at the forge+ boundary; the catalog exposes `user_images` per backend and the /forge UI disables+ text-only engines while reference views are attached.++The NVCF asset upload handshake itself works (asset create + presigned PUT both 200) —+it is the TRELLIS preview function that refuses non-example references.diff --git a/tests/api/forge-tiers.test.js b/tests/api/forge-tiers.test.jsindex 1ac28445d..0f38f5b62 100644--- a/tests/api/forge-tiers.test.js+++ b/tests/api/forge-tiers.test.js@@ -84,4 +84,28 @@ describe('forge-tiers — NVIDIA NIM backend registration', () => {expect(cat.default_backend_for_tier.draft.image).toBe('nvidia');expect(cat.default_backend_for_tier.standard.image).toBe('trellis');});++ // NVIDIA's hosted TRELLIS preview is text-only (rejects every user-image+ // input — see tasks/nvidia-nim/probes/trellis.md). Photo submissions must+ // never default onto it.+ it('routes a photo draft to the standing image backend, not the text-only free lane', () => {+ process.env.NVIDIA_API_KEY = 'nvapi-test';+ expect(resolveBackendId({ path: 'image', tier: 'draft', userImages: true })).toBe('trellis');+ // Prompt-only drafts still get the free lane.+ expect(resolveBackendId({ path: 'image', tier: 'draft', userImages: false })).toBe('nvidia');+ expect(resolveBackendId({ path: 'image', tier: 'draft' })).toBe('nvidia');+ });++ it('honors an explicit nvidia selection in resolution (the handler owns the rejection)', () => {+ process.env.NVIDIA_API_KEY = 'nvapi-test';+ expect(resolveBackendId({ path: 'image', tier: 'draft', backend: 'nvidia', userImages: true })).toBe('nvidia');+ });++ it('declares the text-only capability in the public catalog', () => {+ process.env.NVIDIA_API_KEY = 'nvapi-test';+ const cat = buildCatalog();+ expect(cat.backends.find((b) => b.id === 'nvidia').user_images).toBe(false);+ expect(cat.backends.find((b) => b.id === 'trellis').user_images).toBe(true);+ expect(cat.backends.find((b) => b.id === 'meshy').user_images).toBe(true);+ });});diff --git a/tests/api/providers-nvidia.test.js b/tests/api/providers-nvidia.test.jsindex b1e0d82a2..ead082828 100644--- a/tests/api/providers-nvidia.test.js+++ b/tests/api/providers-nvidia.test.js@@ -25,7 +25,6 @@ import {const TRELLIS_INVOKE = 'https://ai.api.nvidia.com/v1/genai/microsoft/trellis';const NVCF_STATUS = 'https://api.nvcf.nvidia.com/v2/nvcf/pexec/status';-const NVCF_ASSETS = 'https://api.nvcf.nvidia.com/v2/nvcf/assets';const ORIGINAL_FETCH = globalThis.fetch;const ORIGINAL_KEY = process.env.NVIDIA_API_KEY;@@ -125,84 +124,19 @@ describe('nvidia provider — text→3D submit', () => {});});-describe('nvidia provider — image→3D submit + asset-upload branch', () => {- // Route fetch by URL/method so we can model the image fetch, the optional- // NVCF asset handshake, and the invoke in one stub.- function stubImagePipeline({ imageBytes, assetId } = {}) {- const calls = [];- globalThis.fetch = vi.fn(async (url, opts = {}) => {- const u = String(url);- const method = opts.method || 'GET';- calls.push({ url: u, method, headers: opts.headers || {}, body: opts.body });- if (u === 'https://img.three.ws/ref.png') {- return new Response(imageBytes, { status: 200, headers: { 'content-type': 'image/png' } });- }- if (u === NVCF_ASSETS && method === 'POST') {- return jsonResponse({ assetId, uploadUrl: 'https://presigned.nvcf/upload' });- }- if (u === 'https://presigned.nvcf/upload' && method === 'PUT') {- return new Response(null, { status: 200 });- }- if (u === TRELLIS_INVOKE && method === 'POST') {- return jsonResponse({}, 202, { 'nvcf-reqid': 'req-img-1' });- }- throw new Error(`unexpected fetch: ${method} ${u}`);- });- return calls;- }-- it('inlines a small reference image as base64 (no asset handshake)', async () => {- const calls = stubImagePipeline({ imageBytes: Buffer.from('small-png-bytes') });+describe('nvidia provider — image input is not part of the contract', () => {+ // NVIDIA's hosted TRELLIS preview rejects every user-image input form (only+ // example_id 0–3 sample references are accepted — verified live 2026-06-11,+ // see tasks/nvidia-nim/probes/trellis.md). The provider is therefore+ // text-only by design and the forge layer routes photo submissions to the+ // standing image backend instead. Guard the contract so a future imageTo3d+ // comes back deliberately (with a live re-probe), not by accident.+ it('exposes textTo3d + status only — no imageTo3d', () => {+ globalThis.fetch = vi.fn();const provider = createNvidiaProvider();- const job = await provider.imageTo3d({ imageUrl: 'https://img.three.ws/ref.png', tier: 'standard' });-- // No NVCF asset POST happened — only the image fetch + the invoke.- expect(calls.some((c) => c.url === NVCF_ASSETS)).toBe(false);- const invoke = calls.find((c) => c.url === TRELLIS_INVOKE);- const body = JSON.parse(invoke.body);- expect(body.mode).toBe('image');- expect(body.image).toBe(`data:image/png;base64,${Buffer.from('small-png-bytes').toString('base64')}`);- expect(body.ss_sampling_steps).toBe(25); // standard tier- // No asset reference header on the inline path.- expect(invoke.headers).not.toHaveProperty('NVCF-INPUT-ASSET-REFERENCES');- expect(job).toEqual({ kind: 'image-to-3d', taskId: 'req-img-1' });- });-- it('runs the NVCF asset handshake for an image over the inline limit', async () => {- const big = Buffer.alloc(190 * 1024, 1); // > 180 KB inline limit- const calls = stubImagePipeline({ imageBytes: big, assetId: 'asset-xyz' });- const provider = createNvidiaProvider();- await provider.imageTo3d({ imageUrl: 'https://img.three.ws/ref.png' });-- // Asset created, then the raw bytes PUT to the presigned URL.- const create = calls.find((c) => c.url === NVCF_ASSETS && c.method === 'POST');- expect(create).toBeDefined();- const put = calls.find((c) => c.url === 'https://presigned.nvcf/upload' && c.method === 'PUT');- expect(put).toBeDefined();- expect(Buffer.isBuffer(put.body)).toBe(true);- expect(put.body.equals(big)).toBe(true); // the raw bytes, not re-encoded-- const invoke = calls.find((c) => c.url === TRELLIS_INVOKE);- const body = JSON.parse(invoke.body);- expect(body.image).toBe('data:image/png;asset_id,asset-xyz');- expect(invoke.headers['NVCF-INPUT-ASSET-REFERENCES']).toBe('asset-xyz');- });-- it('rejects imageTo3d called without an imageUrl', async () => {- globalThis.fetch = vi.fn(async () => jsonResponse({}, 202, { 'nvcf-reqid': 'x' }));- const provider = createNvidiaProvider();- await expect(provider.imageTo3d({})).rejects.toMatchObject({ code: 'provider_error', status: 400 });- });-- it('maps an unreachable reference-image host to provider_unreachable', async () => {- globalThis.fetch = vi.fn(async () => {- throw new TypeError('fetch failed');- });- const provider = createNvidiaProvider();- await expect(provider.imageTo3d({ imageUrl: 'https://img.three.ws/ref.png' })).rejects.toMatchObject({- code: 'provider_unreachable',- status: 502,- });+ expect(typeof provider.textTo3d).toBe('function');+ expect(typeof provider.status).toBe('function');+ expect(provider.imageTo3d).toBeUndefined();});});