eturchenkov / hayloft

UI tool for LLM frameworks
MIT License
9 stars 2 forks source link

[BUG] Can't connect using 'localhost' [SOLVED] using 0.0.0.0 #3

Closed everydaydigital closed 1 year ago

everydaydigital commented 1 year ago

Hi there, This project looks absolutely awesome, just what I was looking for thank you!

Just wanted to mention that using 'localhost' as the server address doesn't seem to work for me - it simply won't connect when I try to go to http://my-server-ip:7000

However if I update all the lines in this script from localhost to 0.0.0.0 instead, that seems to resolve the issue and I can connect to http://my-server-ip:7000

eg in app.py find & replace:

localhost

With

0.0.0.0

And in logger.py replace

localhost

With

YOUR.PUBLIC.IP.ADDRESS

I am running this in a cloud server (not locally) on port 7000 inside of a docker container on ubuntu, at the same time as my streamlit app on port 8085 that is set up to query llama_index on the same server.

There's always the chance it's my server/network config - but thought I'd mention this in case it helps anyone else getting set up.

eturchenkov commented 1 year ago

Hi @everydaydigital, thanks for your feedback) I've added host & port customization, check it in last version

hayloft start --host 0.0.0.0 --port 7000

Set up where your hayloft server started

from hayloft.llama_index import grab_logs
grab_logs(server="https://your-server:7000")

If you have any questions or suggestions, feel free to join to the discord server https://discord.gg/EKewT5cYMy

everydaydigital commented 1 year ago

Thank you so much! This is working perfectly.

I am using the following script to simplify the procedure within my streamlit python app:

import subprocess
command = "nohup hayloft start --host 0.0.0.0 --port 7000 &"
subprocess.Popen(command, shell=True)

from hayloft.llama_index import grab_logs
grab_logs(server="http://your-server:7000")