Documentation

tracellm start

Start the local TraceLLM runtime.

Overview

The tracellm start command boots the entire TraceLLM observability stack: the FastAPI backend server, WebSocket endpoint, and — optionally — the frontend dashboard. It is the standard way to launch a local development environment.

Syntax

terminalCopy
bash
tracellm start [OPTIONS]
OptionTypeDefaultDescription
--port, -pint8000Port for the API server
--dashboard, -dflagfalseOpen the dashboard in your browser
--dashboard-portint3000Port for the frontend dashboard

What Happens Internally

  1. Loads environment variables from a .env file using python-dotenv.
  2. Checks MongoDB connectivity by pinging the server at MONGO_URL. If unreachable, logs a yellow warning and continues — the API will start without persistence.
  3. Starts the FastAPI server via a subprocess.Popen running uvicorn app.main:app on the specified port with live reload enabled.
  4. Performs a health check by polling http://127.0.0.1:<port>/ with a 15-second timeout. The check retries every 500ms.
  5. Opens the dashboard (if --dashboard is set) in the default browser using webbrowser.open.
  6. Renders a status table showing API Server, MongoDB, Dashboard, and WebSocket status.
  7. Blocks on the API process until Ctrl+C is pressed, then terminates the uvicorn process gracefully.

Example Output

Terminal outputCopy
text
  ╭─── TraceLLM ───────────────────────────────────────────────╮
  │                                                          │
  │   ████████╗██████╗  █████╗  ██████╗███████╗             │
  │   ╚══██╔══╝██╔══██╗██╔══██╗██╔════╝██╔════╝             │
  │      ██║   ██████╔╝███████║██║     █████╗               │
  │      ██║   ██╔══██╗██╔══██║██║     ██╔══╝               │
  │      ██║   ██║  ██║██║  ██║╚██████╗███████╗             │
  │      ╚═╝   ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝╚══════╝             │
  │                                                          │
  │   LLM Observability Platform                             │
  ╰──────────────────────────────────────────────────────────╯

  TraceLLM starting...

  ✓ MongoDB connected
  ✓ API ready
  ✓ WebSocket ready

  ╭── TraceLLM Stack ────────────────────────────────────────╮
  │                                                          │
  │  API Server   ● http://127.0.0.1:8000                    │
  │  MongoDB      ● Connected                                │
  │  Dashboard    ● http://localhost:3000                     │
  │  WebSocket    ws://127.0.0.1:8000/ws                     │
  │                                                          │
  ╰──────────────────────────────────────────────────────────╯

Environment Variables

VariableRequiredDescription
MONGO_URLNo (warning if missing)MongoDB connection string for trace persistence

Warning

Without MONGO_URL, the API starts but traces are not persisted. Set it to a valid MongoDB URI before running traces.

Common Errors

ErrorCauseFix
Port already in useAnother process is using the portUse --port to specify a different port
MongoDB not reachableMongoDB is not running or MONGO_URL is wrongStart MongoDB or check your MONGO_URL value
API failed to startDependency issue or port conflictCheck the uvicorn logs for the exact error

Troubleshooting

Info

If the health check times out, ensure no firewall is blocking the port and that all dependencies are installed. Run pip install tracellm[all] to ensure all extras are available.