Overview
Artifacts in LibreChat allow AI models to generate interactive content that renders in a dedicated preview panel. This includes code snippets, HTML pages, React components, Mermaid diagrams, and more.What Are Artifacts?
Artifacts are structured outputs that can be:- Previewed: Rendered in a side panel during the conversation
- Edited: Modified directly in the interface
- Versioned: Track changes across iterations
- Downloaded: Exported for use outside LibreChat
Supported Artifact Types
- Code
- HTML/Web Pages
- Mermaid Diagrams
- React Components
Syntax-highlighted code in multiple languages:
- Python
- JavaScript/TypeScript
- HTML/CSS
- React/JSX
- And more…
Creating Artifacts
AI models automatically create artifacts when generating appropriate content. You can also request them explicitly:- Implicit Creation
- Explicit Request
Artifact Syntax
AI models use a special directive syntax to create artifacts:Artifact Attributes
Artifact Attributes
- title: Display name of the artifact
- type: Content type (html, python, javascript, react, mermaid, etc.)
- identifier: Unique ID for tracking versions
Enabling Artifacts
Artifacts must be enabled for agents:Artifacts work best with models that support structured output, like GPT-4, Claude, and Gemini.
Artifact Panel Features
Preview Mode
View the rendered output of your artifact:- HTML: Fully interactive web pages
- Code: Syntax-highlighted with line numbers
- Mermaid: Rendered diagrams
- React: Live component previews
Edit Mode
Modify artifacts directly in the code editor:- Syntax highlighting
- Auto-completion
- Line numbers
- Real-time preview updates
Version Control
Track changes across iterations:Download Artifacts
Export artifacts for use outside LibreChat:- Click the download icon in the artifact panel
- Choose file format (HTML, Python, etc.)
- Save to your local machine
Example Use Cases
Data Visualization
Data Visualization
Code Generators
Code Generators
UI Prototypes
UI Prototypes
Documentation Diagrams
Documentation Diagrams
Advanced Features
Artifact Context
Artifacts maintain context across the conversation:Throttled Updates
Artifacts update smoothly during streaming:Route-Specific Rendering
Artifacts only render on the chat route:Best Practices
Configuration Reference
Troubleshooting
Artifact not rendering
Artifact not rendering
- Check that artifacts are enabled for the agent
- Verify the artifact type is supported
- Look for syntax errors in the generated code
- Check browser console for errors
Preview shows blank page
Preview shows blank page
- HTML artifacts may have JavaScript errors
- Check browser console
- Try editing the artifact to fix issues
Download button not working
Download button not working