Skip to main content

Local Development Setup

Prerequisites

  • Python 3.11+
  • Node.js 18+ (for frontend)
  • SSH key (~/.ssh/id_ed25519) with access to the bastion at 100.100.118.18
  • Docker (optional, for container builds)

Steps

1. Clone the Repository

git clone <repo-url> byocusage
cd byocusage

2. Python Environment

python3.11 -m venv .venv
source .venv/bin/activate
pip install -e .

3. Environment Variables

Copy the example and fill in your credentials:

cp .env.example .env

Required variables in .env:

ANTHROPIC_API_KEY=sk-ant-...
STARROCKS_HOST=127.0.0.1
STARROCKS_PORT=9030
STARROCKS_USER=kk
STARROCKS_PASSWORD=Just4Fun1!
STARROCKS_DB=
tip

Set STARROCKS_HOST=127.0.0.1 when using the SSH tunnel locally. The STARROCKS_DB field is left blank -- specify the database per query.

4. SSH Tunnel to StarRocks

ssh -f -N -L 9030:1cogri9tn-internal.cloud-app.celerdata.com:9030 \
ec2-user@100.100.118.18 -i ~/.ssh/id_ed25519

Verify the tunnel:

.venv/bin/python3 -c "
import mysql.connector
c = mysql.connector.connect(host='127.0.0.1', port=9030, user='kk', password='Just4Fun1!')
cur = c.cursor()
cur.execute('SELECT 1')
print('OK:', cur.fetchone())
"

5. Run the Backend

source .venv/bin/activate
uvicorn byoc_agent.app:app --reload --port 8501

6. Run the Frontend

cd frontend
npm install
npm run dev

The Vite dev server starts on http://localhost:5173 and proxies /api requests to the backend on port 8501.

Quick Verification

After both backend and frontend are running:

  1. Open http://localhost:5173
  2. Log in with the credentials in users.yaml
  3. Check the Overview page loads with cluster data