Public
Remixed
Kimi K3 on Modal codes a web page live
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

Kimi Coder

Watch Kimi K3 code a web page live at ~460 tokens/second, served by Modal.

Describe a page, watch the HTML stream in on the left and render live on the right. Each follow-up message extends the spec and regenerates the whole page — at this speed a full regeneration feels like an edit.

How it works

  • index.ts — Hono server: serves the frontend and streams /api/generate as server-sent events
  • kimi.ts — one streaming chat completion against Modal's OpenAI-compatible Kimi K3 endpoint, with reasoning disabled (chat_template_kwargs: { thinking: false }) since the demo is about raw codegen speed
  • frontend/ — React chat + code stream + live preview, with measured tok/s per generation

Remix it

  1. Remix this val
  2. Create a Kimi K3 endpoint at modal.com and a proxy-auth token, then set the endpoint URL in kimi.ts and:

👉 Add MODAL_KEY here: https://www.val.town/x/stevekrouse/kimi-coder/environment-variables?key=MODAL_KEY 👉 Add MODAL_SECRET here: https://www.val.town/x/stevekrouse/kimi-coder/environment-variables?key=MODAL_SECRET