Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

3.7 KB
Raw Blame

Local renderer setup

Setup asks for render mode auto: textured or metallic scenes use a compatible GPU service, starting one lazily when available. Ordinary untextured scenes with zero metalness and no advanced material extensions use CPU views, even with a GPU available. CPU views support silhouette, proportion and contact review, but cannot confirm PBR appearance. Use CLI --render gpu when material review is required, including roughness on nonmetallic surfaces.

The renderer code is included with Kiln; its native GPU dependency is optional at the Kiln package root. For material-dependent tasks, check node kiln.mjs service status before starting the authoring session. If dependencies are missing or incompatible, reinstall the official Kiln package with optional dependencies enabled. npm 11 may print an install-scripts warning for the optional webgpu package; its postinstall only clears the macOS download quarantine from the prebuilt Dawn binary the package ships, so Windows and Linux need nothing and the warning is not an install failure. Read runtime from .kiln/workspace.json to identify the installation. A source checkout uses bun install --frozen-lockfile at that root. Setup checks dependency resolution without loading native code; ready dependencies alone do not prove the device can render.

Once dependencies are available, local CLI/MCP auto mode starts a managed service lazily for a view that needs PBR shading. Compatible clients share it; it survives the initiating session and exits after five minutes without admitted uploads, queued jobs or active renders. From the installation root, node --import ./render-service/src/register-hooks.mjs render-service/src/server.mjs starts a manual service that remains running while idle. It binds loopback; widening HOST requires RENDER_SERVICE_TOKEN.

node kiln.mjs service status reports installation, verified health and lifetime. node kiln.mjs service start joins a compatible service or starts a managed one the way an on-demand view does, and prints its port, renderer, pid, lifetime and build; it starts nothing when a stale, foreign or unknown listener holds the socket. Inside an MCP session, kiln_renderer_status is read-only, so call it freely: activeRoute (gpu or cpu), ready and fallback say what the next render uses, and an active fallback means CPU geometry views, not material evidence. Reprobe only after a repair: after dependency repair or a cached startup failure, call kiln_renderer({action:"reprobe"}) inside the MCP session to refresh its existing route. It neither installs dependencies nor starts a renderer; the next view starts one if needed. CLI service reprobe checks only its own process. Restart the session after changing Kiln, environment variables or credentials. Unknown or incompatible listeners are reported and left alone. service stop explicitly stops a verified local service. If no usable GPU is available, report the material-review limitation and continue on CPU views when that fits the task.

A KILN_RENDER_PORT_URL whose origin is exactly the shared local socket (http://127.0.0.1:8000 by default) takes the local route: it starts on demand and restarts after an idle exit. For rendering on another device, configure the MCP server process's KILN_RENDER_PORT_URL and, when needed, KILN_RENDER_TOKEN through the chosen harness. CLI accepts --render-port URL and reads KILN_RENDER_TOKEN. Start a compatible Kiln renderer on that device; its wider bind requires RENDER_SERVICE_TOKEN unless an authenticated proxy is explicitly configured. Manage the remote service on its own device. Verify the selected route with capabilities and require an actual viewFidelity receipt for material evidence.