Skip to main content
Join the discord for live updates: https://discord.gg/AzyvDHWARx

Updating Chainlit

Begin the migration by updating Chainlit to the latest version:

New Feature: Starters

Starters example

This release introduces a new feature called Starters. Starters are suggestions to help your users get started with your assistant. You can declare up to 4 starters and optionally define an icon for each one.
starters.py
Starters also work with Chat Profiles. You can define different starters for different chat profiles.
starters_with_chat_profiles.py

Rework: Debugging

We created Chainlit with a vision to make debugging as easy as possible. This is why Chainlit was supporting complex Chain of Thoughts and even had its own prompt playground. This was great but was mixing two different concepts in one place:
  1. Building conversational AI with best in class user experience.
  2. Debugging and iterating efficiently.
Separating these two concepts was the right thing to do to:
  1. Provide an even better UX (see the new Chain of Thought).
  2. Provide an even better debugging experience.
You can enable the new debug mode by adding -d to your chainlit run command. If your data layer supports it, you will see a debug button below each message taking you to the trace/prompt playground.

Debug example

This also means we let go of the prompt playground in Chainlit and welcome a simplified Chain of Thought for your users!

Rework: Chain of Thought

The Chain of Thought has been reworked to only be one level deep and only include tools; ultimately users are only interested in the tools used by the LLM to generate the response.
new_cot.py
Notice that the root attribute of cl.Step has been removed. Use cl.Message to send root level messages.

New CoT

The data layer is still be able to provide the full Chain of Thought for debugging purposes.

Rework: Avatars

The previous cl.Avatar element was adding overhead to developers forcing them to resend the avatars to each session. It was also not working with resumed conversations. cl.Avatar has been removed entirely. Now, you should place your avatar files in /public/avatars. Let’s say your message author is My Assistant, then you should place the avatar in /public/avatars/my-assistant.png. If no avatar is found, it will default to the favicon.

Rework: Custom Endpoints

Chainlit is now mountable as a FastAPI sub application. This allows you to use Chainlit on your existing FastAPI application. Check the FastAPI integration and API documentation for more information.

Minor Changes

  1. You can now configure the default theme in the config.toml file.
config.toml
  1. The running, took_one and took_other translations have been replaced by used. Either manually replace them in your translations or delete the translations file to regenerate it.
  2. The show_readme_as_default config has been removed in favor of starters.
  3. Root level messages will no longer collapse.

Conclusion

Full changelog available here.
This pre-release brings a lot of changes to Chainlit. It is not yet stable, but we are excited to hear your feedback on it and improve it further!