I have seen the discussion on OpenWebUI, and it’s lack of ability to set a base url and the problems it causes.
I am trying to get LibreChat up and running as an alternative. It looks as if it allows the setting of a base url with the PUBLIC_URL env variable, but when i try to open the app once launched i get a load of errors:
manifest.webmanifest:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
4684/:1 Manifest fetch from https://ondemand.soton.ac.uk/manifest.webmanifest failed, code 404Understand this error
math-katex.CihyawKy.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
index.Bv_EI6y6.css:1
Failed to load resource: the server responded with a status of 404 (Not Found)Understand this error
manifest.webmanifest:1
Failed to load resource: the server responded with a status of 404 (Not Found)
The base url should be prefixed with: ‘node/nodename.cluster.local/4684/’, which it clearly isnt.
I am running with apptainer. My script.sh.erb to test this looks something like
#!/bin/bash
module load apptainer
module load ollama
export SANDBOX_DIR="/tmp/librechat_sandbox"
export port=$(find_port $host 2000 65000)
export PORT=$port
export host=$(hostname).cluster.local
export base_url=https://ondemand.soton.ac.uk/node/$(hostname).cluster.local:$port
export public_url=/node/$(hostname).cluster.local:$port
echo "got host: $host"
echo "got base_url: $base_url"
echo "got public_url: $public_url"
export MONGO_URI=mongodb://localhost:27017/LibreChat
JWT_SECRET=$(openssl rand -hex 32)
cat <<EOF > connection.yml
---
websocket: true
host: $host
port: $PORT
url: $base_url
EOF
echo "PORT=$PORT" >> "$SANDBOX_DIR/opt/librechat/.env"
echo "PUBLIC_URL=$public_url" >> "$SANDBOX_DIR/opt/librechat/.env"
echo "DOMAIN_CLIENT=$base_url" >> "$SANDBOX_DIR/opt/librechat/.env"
echo "DOMAIN_SERVER=$base_url" >> "$SANDBOX_DIR/opt/librechat/.env"
export HOST=0.0.0.0
echo $url
chmod 644 connection.yml
SIF_PATH="/iridisfs/home/co1f23/ondemand/dev/librechat.sif"
apptainer exec --writable --cleanenv\
--pwd /opt/librechat \
--bind /home/dev/librechat/mongodb_data:/data/mongodb \
--bind /home/dev/librechat/uploads:/app/uploads \
--bind /home/dev/librechat/logs:/data/logs \
--bind /home/dev/librechat/librechat_logs/api_logs:/opt/librechat/api/logs \
--bind /home/dev/librechat/librechat_logs/logs:/opt/librechat/logs \
$SANDBOX_DIR \
bash -c "
echo here
export PUBLIC_URL=$public_url
export BASE_URL=$base_url
export PORT=${port:-3000}
export HOST=0.0.0.0
echo 'about to build'
echo 'Built'
mongod --dbpath /data/mongodb --bind_ip 127.0.0.1 --port 27017 --fork --logpath /data/logs/mongod.log && cd /opt/librechat && \
npm run backend
"
The host and port are correct, as I can see them in my connection.yml file. In the logs for Librechat I see:
Server listening on all interfaces at port 29783. Use ``http://localhost:29783`` to access it
When I log onto the host LibreCHat looks to be running, as a curl on localhost:port pulls back a response. But not when I try to access the app in the web browser.
Has anyone else tried to get this set-up and can see what I am doing incorrectly?