2. Recommendation
4. Execution Process
5. Embedded Preview
Runtime flow
1. Load model/format compatibility seed and prompt catalog.
2. Resolve compatible models using output format + capability flags.
3. Rank models using quality/direct/editable/visual-reference signals.
4. Resolve provider credentials from config.json.
5. Execute selected provider/model.
6. On failure, continue through configured failover order.
7. Normalize response into image, SVG, HTML, Canvas/WebGL, CSS/HTML, or Mermaid artifact.
8. Render artifact inside this page.
9. Export preview as PNG.
Config file
Copy config.example.json to config.json and put your keys there. Do not commit config.json. Browser-side keys are appropriate only for a private/local POC; production should use a backend proxy.
Provider API contracts
OpenRouter image generation uses its dedicated /api/v1/images endpoint; Ollama supports /api/chat and an experimental OpenAI-compatible image generation endpoint; OpenAI is configured around its Responses API for code and Images API for image output. The provider adapter layer isolates these differences.