Build Conversational AI.
Project description
Welcome to Chainlit by Literal AI 👋
Build python production-ready conversational AI applications in minutes, not weeks ⚡️
Website • Documentation • Chainlit Help • Cookbook
https://github.com/user-attachments/assets/b3738aba-55c0-42fa-ac00-6efd1ee0d148
[!NOTE] Chainlit is maintained by Literal AI, an LLMOps platform to monitor and evaluate LLM applications! It works with any Python or TypeScript applications and seamlessly with Chainlit. For enterprise support, please fill this form.
Installation
Open a terminal and run:
pip install chainlit
chainlit hello
If this opens the hello app
in your browser, you're all set!
Development version
The latest in-development version can be installed straight from GitHub with:
pip install git+https://github.com/Chainlit/chainlit.git#subdirectory=backend/
(Requires Node and pnpm installed on the system.)
🚀 Quickstart
🐍 Pure Python
Create a new file demo.py
with the following code:
import chainlit as cl
@cl.step(type="tool")
async def tool():
# Fake tool
await cl.sleep(2)
return "Response from the tool!"
@cl.on_message # this function will be called every time a user inputs a message in the UI
async def main(message: cl.Message):
"""
This function is called every time a user inputs a message in the UI.
It sends back an intermediate response from the tool, followed by the final answer.
Args:
message: The user's message.
Returns:
None.
"""
# Call the tool
tool_res = await tool()
await cl.Message(content=tool_res).send()
Now run it!
chainlit run demo.py -w
📚 More Examples - Cookbook
You can find various examples of Chainlit apps here that leverage tools and services such as OpenAI, Anthropiс, LangChain, LlamaIndex, ChromaDB, Pinecone and more.
Tell us what you would like to see added in Chainlit using the Github issues or on Discord.
💁 Contributing
As an open-source initiative in a rapidly evolving domain, we welcome contributions, be it through the addition of new features or the improvement of documentation.
For detailed information on how to contribute, see here.
📃 License
Chainlit is open-source and licensed under the Apache 2.0 license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chainlit-2.5.5.tar.gz
.
File metadata
- Download URL: chainlit-2.5.5.tar.gz
- Upload date:
- Size: 9.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
d6388f93b9089e3a80bc2bd286a157a4a9d8016dc2c806372fd77119bcc0d36c
|
|
MD5 |
1d3ce4c6793f4b9b3d6161dcae071347
|
|
BLAKE2b-256 |
d932e4a6ac0a8e7430cd7b76b712b8df2f83abf129e7b843180e319f647fd3be
|
File details
Details for the file chainlit-2.5.5-py3-none-any.whl
.
File metadata
- Download URL: chainlit-2.5.5-py3-none-any.whl
- Upload date:
- Size: 9.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
1783c7b868fe41158283b498020fa18a23c39d07319ad9927e429f1e888f6eb5
|
|
MD5 |
7c090b27fe684dc4bff7e926a46c413d
|
|
BLAKE2b-256 |
d8b29bf8c07b18ef34dc70771a0e21f6f0a5392dd3a753135743178cd59f1b7f
|