Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.92k stars 912 forks source link

Use Chainlit on SageMaker Studio #59

Open geodra opened 1 year ago

geodra commented 1 year ago

I tried to deploy a Chainlit app on SM studio running this command chainlit run app.py -w --port 6001 and access it through this url -> https://.studio..sagemaker.aws/jupyter/default/proxy/6001/ but nothing was being rendered.

Streamlit & Gradio APPs can be easily rendered on SM studio as per this repo -> https://github.com/machinelearnear/use-gradio-streamlit-sagemaker-studiolab

willydouhard commented 1 year ago

Are you using studio or studio labs? I requested access to studio labs to try myself

geodra commented 1 year ago

I use SageMaker Studio on AWS. You first need to create a domain and then inside a domain a user. SM studio is very similar to Jupyter Lab but with steroids you can do extra stuff like visualizing the pipelines, navigate Jumpstart solution etc. It is weird because when I try to open the page the title says Chatbot but nothing is being rendered as per the image below. Do I need to add some other arguments when running chainlit run Screenshot 2023-06-14 at 10 06 54

willydouhard commented 1 year ago

Can you open the browser console (right click inspect) and check if you have errors in the console?

geodra commented 1 year ago

This is what I get when I inspect the page. image

willydouhard commented 1 year ago

Okay, so it is able to get the initial HTML from the chainlit server but then it cannot load the JS and CSS files. Maybe there is an issue with a proxy in between? I will investigate.

willydouhard commented 1 year ago

I suspect this is the same issue as #38

geodra commented 1 year ago

Any update on this issue?

willydouhard commented 1 year ago

Not yet, I think the problem is that the chainlit app is not served at the root of the domain or subdomain. Do you have a way to set a direct domain name or subdomain for your app on sagemaker studio?

duyongan commented 1 year ago

Any update?

willydouhard commented 1 year ago

This is has not been addressed yet. The fix for the moment would be to serve your sage maker endpoint from a subdomain. That way the chainlit app would be served at the root level