Skip to content

Getting Started

Sergey Gerasimov edited this page Oct 23, 2026 · 5 revisions

Getting Started

Requirements

  • Docker Desktop, Docker Engine, or another Docker installation with Compose v2
  • About 4 GB of free RAM
  • A browser

Python, a database, and a market-data subscription are not required.


1. One-command demo (recommended)

docker run --rm -p 8501:8501 ghcr.io/sergeyger/derivlab:latest

Open http://localhost:8501. The image includes the bundled seed and runs the deterministic local AI models; no API key is required.

View the GHCR package · tags: latest, 1.2.0, sha-<short>.

Live demo: Try the offline demo.

Prefer to deploy your own? Use the Try the offline demo button. Streamlit Community Cloud builds from GitHub; the first deploy requires authorizing Streamlit with GitHub. The app itself needs no secrets.


2. Run with Docker Compose

git clone https://github.com/SergeyGer/DerivLab.git
cd DerivLab
docker compose up --build

Open http://localhost:8501.

The first build takes a few minutes because native build tools are isolated in a builder stage. The app starts from the bundled five-year seed, so the demo works offline.

Stop and restart

docker compose stop      # keep the container and cache
docker compose up -d     # start again
docker compose down      # remove the container (the named cache volume remains)

3. Optional: connect a live AI model

The AI Arena is fully functional without a key. If you want live OpenAI critic and news, create a local .env file:

cp .env.example .env
# edit .env and set:
# DERIVLAB_LLM_PROVIDER=openai
# DERIVLAB_LLM_API_KEY=sk-...
# DERIVLAB_CRITIC_MODEL=gpt-4.1
# DERIVLAB_NEWS_MODEL=gpt-4.1-mini
docker compose up -d --force-recreate

The app shows the actual active model names in the sidebar, rival cards, leaderboard, report header, and Model Stack tab. It never renders the API key.

GPT-5 note: gpt-5 and gpt-5-mini require organization verification. If OpenAI returns a 404 asking you to verify the organization, use gpt-4.1 / gpt-4.1-mini or another model available to your account. See AI Model Guide.

For Anthropic, Ollama, vLLM, LM Studio, and other providers, see the AI Model Guide.


4. Refresh market data

The app works with the bundled seed. To refresh locally:

From the UI: Data Vault → Refresh all (5Y).

From the command line:

docker compose run --rm derivlab-seed

The seeder retries transient failures and never deletes a good cache file when a download fails. See Data Pipeline.


5. Local development (optional)

python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements-dev.txt
streamlit run app.py

The local launcher reads a project-root .env automatically. Shell environment variables take priority over the file.

Run the test suite:

pytest -q
ruff check .

6. VS Code Dev Containers

The repository includes .devcontainer/:

  1. Install the Dev Containers extension.
  2. Open the repository.
  3. Dev Containers: Reopen in Container.

The container runs Python 3.11, forwards port 8501, installs dependencies, and uses shutdownAction: stopContainer. It is designed for developers on different laptops and avoids host-specific paths. See Deployment.


7. Verify the installation

curl -fsS http://127.0.0.1:8501/_stcore/health
docker inspect derivlab-app --format '{{.State.Health.Status}}'

Expected: 200 from the health endpoint and healthy from Docker.


Next

Clone this wiki locally