chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

How can I deploy Chainlit with multiple instances

Open GodgyQing opened this issue 3 months ago • 9 comments

How can I deploy Chainlit with multiple instances for load balancing, and ensure session or chat state is shared across all instances?

Image

GodgyQing avatar Oct 20 '25 03:10 GodgyQing

this is my nginx conf

Image

GodgyQing avatar Oct 20 '25 03:10 GodgyQing

How can I deploy Chainlit with multiple instances for load balancing, and ensure session or chat state is shared across all instances?

Image

GodgyQing avatar Oct 20 '25 03:10 GodgyQing

One simple solution is to set transport=websocket in your toml file.

nethi avatar Oct 20 '25 13:10 nethi

One simple solution is to set transport=websocket in your toml file.

Thank you, but when I upload an image and check the history, the image does not appear on other devices.

GodgyQing avatar Oct 21 '25 00:10 GodgyQing

Same here. This is a must fix issue to take Chainlit apps to production.

lamsalsamip1 avatar Oct 21 '25 05:10 lamsalsamip1

In addition to using nginx to solve this problem, is there a way similar to redis caching to achieve multi-instance session sharing? Are there any brothers who can share

jagerzhang avatar Oct 22 '25 03:10 jagerzhang

This was brought up a few times before, in #1513 and #1872. There were some suggestions for resolving this in these threads, but nothing concrete as of yet.

KeemOnGithub avatar Oct 27 '25 01:10 KeemOnGithub

So I run with 3x pods on EKS, and solved it with enabling stickiness.. Not a perfect solution (since the load balancer cant move people around pods, but it works just fine)

https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_TargetGroupAttribute.html

buzzCraft avatar Oct 27 '25 08:10 buzzCraft

This issue is stale because it has been open for 14 days with no activity.

github-actions[bot] avatar Nov 11 '25 02:11 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Nov 19 '25 02:11 github-actions[bot]