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.

Add NVIDIA 3D and NIM self-host tutorials; wire tutorials manifest

nirholasba5006d82afc
diff --git a/docs/tutorials/nvidia-3d-free.md b/docs/tutorials/nvidia-3d-free.md
new file mode 100644
index 000000000..27135fdc3
--- /dev/null
+++ b/docs/tutorials/nvidia-3d-free.md
@@ -0,0 +1,110 @@
+# Generate 3D Models Free, Powered by NVIDIA
+
+Every free text-to-3D generation in the Forge runs on **NVIDIA NIM** with **Microsoft TRELLIS** — a GPU model that turns a description into real, textured geometry. No API key, no credits, no cost to you. This tutorial shows what the free lane is, when it kicks in, how to get the best out of it, and how to watch TRELLIS rebuild a mesh live.
+
+**What you'll make:** a 3D model generated for free on the NVIDIA NIM lane, downloaded as a GLB.
+
+**Prerequisites:** none. No account, no wallet, no code. Just a browser.
+
+---
+
+## What the free NVIDIA lane is
+
+When you type a prompt into the Forge, the default path is:
+
+1. Your words become a **reference image**.
+2. That image is reconstructed into a textured 3D mesh by **TRELLIS**, served on **NVIDIA NIM** (NVIDIA's inference microservice for hosted models).
+3. The mesh is packaged as a **GLB** — the standard 3D file the whole web understands.
+
+NVIDIA NIM keeps the GPU warm, so there's no slow cold start, and the lane costs the platform nothing per call — which is why it's the free default at the **Draft** and **Standard** tiers. You don't select it; it's simply what runs when you generate without bringing your own engine key.
+
+---
+
+## Step 1 — Open the Forge
+
+Go to [three.ws/forge](/forge). You'll land on the **Describe it** tab — text-to-3D mode.
+
+Leave the **Engine** selector on its default. That's the free NVIDIA NIM lane. (Bringing your own geometry engine key is optional and covered in [Turn a Text Prompt into a 3D Model](/tutorials/text-to-3d) — skip it here.)
+
+---
+
+## Step 2 — Describe one object
+
+Type a single subject and name its material:
+
+```
+a glazed ceramic teapot
+```
+
+Keep prompts short. TRELLIS reads roughly the first **77 characters**, so a tight description beats a paragraph. Three rules:
+
+1. **One object per prompt.** "a teapot" works; "a teapot on a table by a window" confuses it.
+2. **Name the material.** "brushed metal", "worn leather", "glazed ceramic".
+3. **No scenery.** You're describing a thing, not a photo — drop backgrounds and lighting moods.
+
+Want a cookbook? See [Prompt Recipes for 3D Generation](/tutorials/prompts-for-3d).
+
+---
+
+## Step 3 — Pick a tier (both free lanes)
+
+| Tier | What you get | Speed |
+|------|-------------|-------|
+| **Draft** | Fast, low-poly (~12k triangles) | ~15 s — generate five, keep the best shape |
+| **Standard** | Balanced detail (~30k triangles) | ~1 min — the everyday default |
+
+Both Draft and Standard route to the free NVIDIA NIM lane for text prompts. Higher tiers and photo input use other engines — see [What's next](#whats-next).
+
+The tier maps to TRELLIS **sampling steps**: more steps, more refinement, more time. Draft runs lean; Standard spends a little longer for cleaner geometry.
+
+---
+
+## Step 4 — Generate and inspect
+
+Click **Generate**. The Forge narrates each step — *painting reference image → reconstructing textured mesh → finalizing GLB* — and the preview image appears early, so you'll know within seconds whether it's on track.
+
+When it finishes, the model loads in a live viewer:
+
+- **Drag** to rotate, **scroll** to zoom.
+- Press **F** for a fullscreen turntable; **Esc** to exit.
+- Check the **back and underside** — that's where reconstruction flaws hide.
+
+Then rate it **👍 Keep** or **👎 Discard**. Your verdicts feed the engine picker, so honest ratings make your future generations better.
+
+---
+
+## Step 5 — Watch TRELLIS run live (the NIM demo)
+
+To see the NVIDIA NIM contract end to end — no UI in the way — open the live demo at [three.ws/forge-nim](/forge-nim).
+
+It talks **directly** to a TRELLIS NIM and returns the GLB **synchronously** in a single call. Type a prompt or drop a photo, and you'll watch the raw model come back as bytes and render in the browser. It's the clearest way to understand what "powered by NVIDIA NIM" actually means — the same TRELLIS reconstruction the Forge uses, with the wire contract visible.
+
+> The hosted NVIDIA preview only generates from **text prompts**. To reconstruct from your own **photos** on a NIM, you need a self-hosted TRELLIS NIM — that's the next tutorial.
+
+---
+
+## Step 6 — Download or share
+
+- **Download GLB** — opens in Blender, three.js, Unity, Unreal, Windows 3D Viewer, and macOS Quick Look.
+- **Share** — a link with a proper preview card.
+- Every generation is also saved to **Your creations** at the bottom of the page, tied to your browser.
+
+---
+
+## Didn't get what you wanted?
+
+| What went wrong | What to change |
+|-----------------|----------------|
+| Right object, wrong style | Add a style word: "low-poly", "realistic", "stylized" |
+| Surface looks flat | Name the material, or run the **High** tier for PBR textures |
+| Extra junk attached | Your prompt described a scene — cut it to just the object |
+| "Generation limit reached" | The free lane is rate-limited per visitor. Wait a minute |
+
+---
+
+## What's next
+
+- **Generate from your photos** → [Turn Photos into a 3D Model](/tutorials/image-to-3d).
+- **Run TRELLIS on your own GPU** → [Run Microsoft TRELLIS on your own NVIDIA NIM](/tutorials/nvidia-nim-self-host) — self-host the NIM and reconstruct from photos too.
+- **Generate from code** → [Generate 3D Models from Code](/tutorials/generate-3d-api) — the same engine as a plain HTTP API.
+- **Use it as an agent body** → [Build your first agent](/tutorials/first-agent).
diff --git a/docs/tutorials/nvidia-nim-self-host.md b/docs/tutorials/nvidia-nim-self-host.md
new file mode 100644
index 000000000..c641fa46b
--- /dev/null
+++ b/docs/tutorials/nvidia-nim-self-host.md
@@ -0,0 +1,166 @@
+# Run Microsoft TRELLIS on Your Own NVIDIA NIM
+
+The free Forge lane uses NVIDIA's **hosted** TRELLIS preview, which only generates from text prompts. To reconstruct a 3D model from **real photos** — and to own the whole pipeline — you run the **TRELLIS NIM container** on your own NVIDIA GPU and point three.ws at it. This tutorial wires up a self-hosted NIM and drives it through the exact contract three.ws uses.
+
+**What you'll build:** your own NVIDIA NIM serving text- and image-to-3D, reachable through the three.ws `/api/forge-nim` endpoint and the live [/forge-nim](/forge-nim) demo.
+
+**Prerequisites:** an NVIDIA GPU (an L4 or better is plenty), Docker with the NVIDIA Container Toolkit, and an [NVIDIA NGC](https://ngc.nvidia.com) account for the API key that pulls NIM containers.
+
+---
+
+## Step 1 — Pull and run the TRELLIS NIM
+
+TRELLIS ships as a NIM container at `nvcr.io/nim/microsoft/trellis` (the `large:image` build accepts real reference images).
+
+```bash
+# Log in to NGC with your NVIDIA API key
+docker login nvcr.io -u '$oauthtoken' -p "$NGC_API_KEY"
+
+# Run the NIM — it serves an OpenAPI inference server on :8000
+docker run --rm --gpus all \
+ -e NGC_API_KEY="$NGC_API_KEY" \
+ -p 8000:8000 \
+ nvcr.io/nim/microsoft/trellis:latest
+```
+
+The container exposes two endpoints three.ws relies on:
+
+- `GET /v1/health/ready` — readiness probe (NIM convention).
+- `POST /v1/infer` — reconstruct a GLB, returned **synchronously**.
+
+A cold `large:image` build can take a while on its first hit; after that an L4 reconstructs in roughly **15–45 seconds**.
+
+---
+
+## Step 2 — Expose it over HTTPS
+
+three.ws will only talk to a NIM over **https** whose host isn't a private, loopback, link-local, or cloud-metadata address — an SSRF guard, so the proxy can never be turned into an internal-network probe. Put your container behind a TLS terminator with a public hostname:
+
+- a reverse proxy (Caddy/nginx) with a real certificate, or
+- a tunnel (Cloudflare Tunnel, `ngrok`), or
+- a managed GPU host (Cloud Run, a GPU VM) with HTTPS in front.
+
+The result is a base URL like `https://trellis.yourdomain.com`.
+
+---
+
+## Step 3 — Point three.ws at your NIM
+
+Set two environment variables on your three.ws deployment:
+
+| Variable | What it is |
+|----------|-----------|
+| `MODEL_TRELLIS_URL` | The public https origin of your NIM, e.g. `https://trellis.yourdomain.com` |
+| `NVIDIA_API_KEY` | Bearer token forwarded to the NIM (if your gateway requires auth) |
+
+```bash
+vercel env add MODEL_TRELLIS_URL production
+vercel env add NVIDIA_API_KEY production
+```
+
+Confirm three.ws can see it:
+
+```bash
+curl "https://three.ws/api/forge-nim?action=health"
+# → { "configured": true, "reachable": true, "baseUrl": "https://trellis.yourdomain.com", "endpoint": ".../v1/infer", "detail": "" }
+```
+
+`configured` means the URL is set; `reachable` means the readiness probe answered.
+
+---
+
+## Step 4 — Reconstruct from a prompt
+
+`POST /api/forge-nim` is a thin, honest proxy: it shapes the request, forwards it to your NIM's `/v1/infer`, and hands the GLB straight back as base64.
+
+```bash
+curl -X POST "https://three.ws/api/forge-nim" \
+ -H "content-type: application/json" \
+ -d '{ "mode": "text", "prompt": "a glazed ceramic teapot", "tier": "draft" }'
+```
+
+Response:
+
+```json
+{
+ "ok": true,
+ "mode": "text",
+ "tier": "draft",
+ "contract": "artifacts[0].base64",
+ "endpoint": "https://trellis.yourdomain.com/v1/infer",
+ "bytes": 184320,
+ "ms": 21540,
+ "glb_base64": "Z2xURgIAAAA..."
+}
+```
+
+Decode `glb_base64` to a file:
+
+```bash
+node -e 'const b=require("fs").readFileSync(0,"utf8");const o=JSON.parse(b);require("fs").writeFileSync("teapot.glb",Buffer.from(o.glb_base64,"base64"))' < response.json
+```
+
+`tier` maps to TRELLIS sampling steps — `draft` runs 15/15 (sparse-structure / structured-latent steps), `high` runs 40/40 for more refinement. Prompts are truncated to TRELLIS's 77-character window, so keep them tight.
+
+---
+
+## Step 5 — Reconstruct from a photo
+
+This is the payoff of self-hosting: a NIM accepts a **real reference image** (the hosted preview won't). Send a data URI or a public image URL:
+
+```bash
+curl -X POST "https://three.ws/api/forge-nim" \
+ -H "content-type: application/json" \
+ -d '{ "mode": "image", "image": "https://example.com/chair.jpg", "tier": "high" }'
+```
+
+Reference images are capped at **10 MB**. The same `{ glb_base64, bytes, ms }` envelope comes back.
+
+---
+
+## Step 6 — See it in the browser
+
+Open [three.ws/forge-nim](/forge-nim). The demo page calls the same `/api/forge-nim` endpoint, decodes the returned base64 into a Blob, and renders the GLB in a live viewer — text mode and photo dropzone both. It's the fastest way to confirm your NIM is wired correctly, with the NVIDIA NIM wire contract visible end to end: no R2 round-trip, no mocks, the raw bytes straight from your GPU.
+
+---
+
+## The raw NIM contract
+
+If you'd rather call your NIM directly (bypassing three.ws), this is the contract `/api/forge-nim` speaks:
+
+```http
+POST {baseUrl}/v1/infer
+{
+ "mode": "image" | "text",
+ "image": "data:image/png;base64,..." // image mode
+ "prompt": "a glazed ceramic teapot", // text mode
+ "ss_sampling_steps": 15,
+ "slat_sampling_steps": 15,
+ "output_format": "glb",
+ "seed": 0 // optional, for reproducibility
+}
+
+200 { "artifacts": [ { "base64": "<glb>" } ] }
+```
+
+The proxy normalizes every documented artifact shape (inline `base64`, a bare string, a `data` field, or a URL artifact) to GLB bytes, so your NIM build just needs to return one of them.
+
+---
+
+## Troubleshooting
+
+| Symptom | Cause & fix |
+|---------|-------------|
+| `configured: false` from health | `MODEL_TRELLIS_URL` isn't set on the deployment |
+| `reachable: false` | The NIM's `/v1/health/ready` didn't answer — check the container and your TLS front |
+| `nim_timeout` (504) | Cold `large:image` start; retry once the GPU is warm |
+| `nim_auth` (502) | The NIM rejected the bearer — check `NVIDIA_API_KEY` or your gateway auth |
+| `bad_base_url` (400) | An override `baseUrl` was http, an IP literal, or a private/`.internal` host |
+
+---
+
+## What's next
+
+- **The no-code version** → [Generate 3D Models Free, Powered by NVIDIA](/tutorials/nvidia-3d-free).
+- **Batch it from code** → [Generate 3D Models from Code](/tutorials/generate-3d-api).
+- **Run the whole backend yourself** → [Self-host the agent backend](/tutorials/self-host-agent-backend).
diff --git a/pages/forge-nim.html b/pages/forge-nim.html
index 4f04911d0..ee7a27143 100644
--- a/pages/forge-nim.html
+++ b/pages/forge-nim.html
@@ -47,84 +47,6 @@
margin: 0;
padding: var(--space-md) clamp(var(--space-md), 4vw, var(--space-2xl)) var(--space-2xl);
}
- .forge-head {
- display: flex;
- align-items: baseline;
- flex-wrap: wrap;
- gap: var(--space-md);
- height: auto;
- padding: 0 0 var(--space-md);
- background: none;
- backdrop-filter: none;
- -webkit-backdrop-filter: none;
- border-bottom: 1px solid var(--stroke);
- overflow: visible;
- white-space: normal;
- line-height: var(--leading-normal);
- margin-bottom: var(--space-lg);
- }
- .forge-head h1 {
- font-family: var(--font-display);
- font-size: var(--text-xl);
- line-height: 1;
- margin: 0;
- color: var(--ink);
- flex: none;
- }
- .forge-head .nvbadge {
- font-family: var(--font-mono);
- font-size: var(--text-2xs, 0.66rem);
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: #76b900;
- border: 1px solid rgba(118, 185, 0, 0.4);
- background: rgba(118, 185, 0, 0.08);
- border-radius: 999px;
- padding: 0.15rem 0.55rem;
- align-self: center;
- }
- .forge-head p {
- color: var(--ink-dim);
- font-size: var(--text-sm);
- margin: 0;
- line-height: var(--leading-normal);
- flex: 1 1 320px;
- min-width: 0;
- }
-
- /* Health pill ------------------------------------------------- */
- .nim-status {
- display: inline-flex;
- align-items: center;
- gap: 0.5rem;
- font-family: var(--font-mono);
- font-size: var(--text-xs);
- color: var(--ink-dim);
- border: 1px solid var(--stroke);
- border-radius: 999px;
- padding: 0.3rem 0.7rem;
- background: var(--surface-1);
- align-self: center;
- }
- .nim-status .dot {
- width: 0.55rem;
- height: 0.55rem;
- border-radius: 50%;
- background: var(--ink-dim);
- box-shadow: 0 0 0 0 rgba(118, 185, 0, 0.5);
- transition: background 0.2s;
- }
- .nim-status[data-state='live'] .dot {
- background: #76b900;
- box-shadow: 0 0 10px rgba(118, 185, 0, 0.7);
- }
- .nim-status[data-state='down'] .dot {
- background: var(--warning, #e0a93e);
- }
- .nim-status[data-state='off'] .dot {
- background: var(--ink-faint, #555);
- }
-
/* Workspace --------------------------------------------------- */
.forge-workspace {
display: grid;
@@ -761,10 +683,6 @@
</div>
<p class="note">
- Native image→3D runs only against a self-hosted NIM — NVIDIA's hosted NVCF preview is
- text-only and rejects real photos. This page talks to your NIM through a thin, SSRF-guarded
- proxy (<code>/api/forge-nim</code>); the GLB never leaves your infrastructure except to your own browser.
- Need the production multi-engine forge instead? <a href="/forge">Open Forge</a>.
<span class="sample-row" id="sample-row">
<button type="button" data-sample="text" data-prompt="a worn brass pocket watch, studio lighting">Try a text prompt</button>
</span>
diff --git a/public/tutorials-manifest.js b/public/tutorials-manifest.js
index a220edfb8..7b0e60633 100644
--- a/public/tutorials-manifest.js
+++ b/public/tutorials-manifest.js
@@ -50,6 +50,16 @@
previewModel: '/animations/robotexpressive.glb',
ctaPrimary: { label: 'Open the Forge', href: '/forge' },
},
+ {
+ slug: 'nvidia-3d-free',
+ tier: 'easy',
+ title: 'Generate 3D models free, powered by NVIDIA',
+ blurb: "The Forge's free text-to-3D runs on NVIDIA NIM with Microsoft TRELLIS — no key, no cost. Learn what the free lane does, when it kicks in, and how to watch TRELLIS rebuild a mesh live.",
+ builds: 'A 3D model generated free on the NVIDIA NIM lane, downloaded as a GLB',
+ time: '8 min',
+ previewModel: '/animations/robotexpressive.glb',
+ ctaPrimary: { label: 'Open the NIM demo', href: '/forge-nim' },
+ },
{
slug: 'embed-in-30-seconds',
tier: 'easy',
@@ -344,6 +354,16 @@
previewModel: '/avatars/cz.glb',
ctaPrimary: { label: 'See paid calls', href: '/pay/calls' },
},
+ {
+ slug: 'nvidia-nim-self-host',
+ tier: 'advanced',
+ title: 'Run Microsoft TRELLIS on your own NVIDIA NIM',
+ blurb: 'Self-host the TRELLIS NIM container on an NVIDIA GPU, point three.ws at it, and reconstruct a textured GLB from a prompt or a photo in one synchronous /v1/infer call.',
+ builds: 'Your own NVIDIA NIM serving text- and image-to-3D, wired into three.ws',
+ time: '60 min',
+ previewModel: '/animations/soldier.glb',
+ ctaPrimary: { label: 'Open the NIM demo', href: '/forge-nim' },
+ },
{
slug: 'self-host-agent-backend',
tier: 'advanced',