Documentation Index
Fetch the complete documentation index at: https://docs.chainlit.io/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before getting started, make sure you have the following:- A working installation of Chainlit
- The Mistral AI python client package installed,
mistralai - A Mistral AI API key
- Basic understanding of Python programming
Step 1: Create a Python file
Create a new Python file namedapp.py in your project directory. This file will contain the main logic for your LLM application.
Step 2: Write the Application Logic
Inapp.py, import the necessary packages and define one function to handle messages incoming from the UI.
Step 3: Fill the environment variables
Create a file named.env in the same folder as your app.py file. Add your Mistral AI API key in the MISTRAL_API_KEY variable.
Step 4: Run the Application
To start your app, open a terminal and navigate to the directory containingapp.py. Then run the following command:
-w flag tells Chainlit to enable auto-reloading, so you don’t need to restart the server every time you make changes to your application. Your chatbot UI should now be accessible at http://localhost:8000.