> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ChainlitUI Module

> Chainlit-based user interface for PraisonAI

# ChainlitUI Module

The ChainlitUI module provides a Chainlit-based user interface for interacting with PraisonAI agents.

## Prerequisites

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install chainlit
```

## Import

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.chainlit_ui import *
```

## Quick Start

1. Create a `chainlit_app.py` file:

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
from praisonai.chainlit_ui import *
```

2. Run with Chainlit:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
chainlit run chainlit_app.py
```

## Features

### Chat Profiles

The UI supports multiple chat profiles:

* **Auto**: Automatically generate agents and tasks based on input
* **Manual**: Configure agents manually from YAML

### Starter Prompts

Pre-configured starter prompts for common use cases:

* Create a movie script
* Design a fantasy world
* Write a futuristic political thriller
* Develop a mystery novel
* Plan a sci-fi adventure

## Configuration

### Environment Variables

| Variable            | Description  | Default                     |
| ------------------- | ------------ | --------------------------- |
| `OPENAI_MODEL_NAME` | Model to use | `gpt-4o-mini`               |
| `OPENAI_API_BASE`   | API base URL | `https://api.openai.com/v1` |
| `OPENAI_API_KEY`    | API key      | Required                    |

### Agent Configuration

Configure agents via `agents.yaml`:

```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
agents:
  - name: Researcher
    role: Research Specialist
    goal: Research topics thoroughly
    tools:
      - web_search
      
  - name: Writer
    role: Content Writer
    goal: Write engaging content
    
tasks:
  - agent: Researcher
    task: Research the given topic
  - agent: Writer
    task: Write content based on research
```

## Actions

### Run Action

Execute the configured agents with the current input.

### Modify Action

Modify agents and tools from the settings panel.

## Example: Custom Chainlit App

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import chainlit as cl
from praisonai.agents_generator import AgentsGenerator
from praisonai.auto import AutoGenerator

@cl.on_chat_start
async def start():
    await cl.Message(
        content="Welcome to PraisonAI! What would you like to create?"
    ).send()

@cl.on_message
async def main(message: cl.Message):
    # Auto-generate agents based on user input
    generator = AutoGenerator(topic=message.content)
    agents_config = generator.generate()
    
    # Run the agents
    agents = AgentsGenerator(agents_config)
    result = agents.run()
    
    await cl.Message(content=result).send()
```

## Chat Settings

Configure via the Chainlit settings panel:

* **Framework**: Choose between CrewAI, AutoGen, PraisonAI, or Google ADK
* **Model**: Select the LLM model
* **Agent File**: Path to agents.yaml configuration

## Related

* [UI Overview](/docs/ui/overview) - UI options
* [AgentsGenerator Module](/docs/sdk/praisonai/agents_generator) - Agent generation
* [Auto Module](/docs/sdk/praisonai/auto) - Auto-generation
