Skip to main content

Code to run the frontend app

Project description

chATLAS

Welcome to the repository for the frontend of chATLAS: An AI assistant for the ATLAS collaboration

Main app (more stable): https://chatlas-flask-chatlas.app.cern.ch

Staging area (contains newer features, less stable): https://chatlas-staging-chatlas.app.cern.ch

If you want to install the app for development work, follow the instructions below:

Requirements

You will need to set the following environment variables for the app to run

export CHATLAS_OPENAI_KEY=... # Feel free to use a personal OpenAI API key here
export CHATLAS_DB_PASSWORD=...
export CHATLAS_EMBEDDING_MODEL_PATH=...
export CHATLAS_GROQ_KEY=...
export CHATLAS_GROQ_BASE_URL=http://cs-513-ml003:3000 # this will change if not on CERN network, see below

Reach out to the developers by email or on mattermost to get setup.

If running locally (not on lxplus), you'll need a local copy of the embedding model, see these instructions

Environment creation

Move to the directory containing this file and run:

uv sync

Running the app

  1. Ensure you have the venv and necessary environment variables
export CHATLAS_OPENAI_KEY=...
export CHATLAS_DB_PASSWORD=...
export CHATLAS_EMBEDDING_MODEL_PATH=...
export CHATLAS_GROQ_KEY=...
export CHATLAS_PORT_FORWARDING=1

We recommend putting this into a .env file in the root directory of the project. Then you can load in the environment variables from the file with:

set -a
source .env
set +a
  1. Setup port forwarding for the DBOD instances

note If you are connected to the CERN network, skip this step

# forward the all DBs
ssh -N \
  -L 6624:dbod-chatlas.cern.ch:6624 \
  -L 6606:dbod-chatlas-cds.cern.ch:6606 \
  -L 3000:cs-513-ml003:3000 \
  "$LXPLUS_USERNAME"@lxplus.cern.ch
  1. Launch
uv run --env-file .env chATLAS_Frontend/launch.py --local-mode --db-host cern-prod --port-forwarding
  1. Viewing the output

After launching, you should get some terminal output like " * Running on http://127.0.0.1:5000"

If running locally, just open this link

If on lxplus, you need to port-forward the address to your local machine. Note the lxplus node you are on and run:

ssh -L 5000:127.0.0.1:5000 <USERNAME>@lxplus<NUMBER>.cern.ch

Getting the Embedding Model

The embedding model is now stored on EOS. To run locally you need to download the embedding model:

scp <USERNAME>@lxplus.cern.ch:/eos/atlas/atlascerngroupdisk/phys-mlf/Chatlas/multi-qa-mpnet-base-dot-v1-ATLAS-TALK <LOCAL PATH TO STORE MODEL>

Then export environment variable:

export CHATLAS_EMBEDDING_MODEL_PATH = <LOCAL PATH TO STORE MODEL>

Updating the environment

Edit pyproject.toml and run uv sync to update the lockfile

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chatlas_frontend-1.0.0.tar.gz (121.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chatlas_frontend-1.0.0-py3-none-any.whl (133.3 kB view details)

Uploaded Python 3

File details

Details for the file chatlas_frontend-1.0.0.tar.gz.

File metadata

  • Download URL: chatlas_frontend-1.0.0.tar.gz
  • Upload date:
  • Size: 121.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for chatlas_frontend-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4d5d03e7e8066d2df7e69d9269ece75e7404ed9c456da1ba3367eaf3920e9ad6
MD5 f1d62bdf4c2f31bbd10ba0cec7496cb3
BLAKE2b-256 5cf865f76d9d9dbf85fac51ff7f49ed61d5ca623ad0b7b8f93f9acbb81de3b36

See more details on using hashes here.

File details

Details for the file chatlas_frontend-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: chatlas_frontend-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 133.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for chatlas_frontend-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad51c7d6ed4fead133280e357d3aa0c0e5eb62b699028f78f7d1c3582d80731f
MD5 642c7a421c41773e7eb14b1dddc4866f
BLAKE2b-256 a2a4322e1b89f2fb74ac2d2e09aade586a7865df299bd798bfa5e48fcd75eb88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page