Skip to content

Self-Hosting

Advanced users only

Self-hosting is for contributors and organizations that need to run G6 on their own infrastructure. Most users should install G6 locally as a Claude Code plugin.

For contributors working on G6Solver itself, or for running a self-hosted instance.

Prerequisites

Requirement Version Notes
Python 3.12+ 64-bit interpreter required
Poetry 2.3+ With poetry-polylith-plugin and poetry-multiproject-plugin
RAM 4 GB min 8 GB recommended for full stack
Storage ~2 GB For dependencies and development environment
Git 2.x+ Required for workspace and GitRollbackManager

Install Poetry plugins

poetry self add [email protected]
poetry self add [email protected]

Install

G6 is distributed directly — there is no public repository to clone. If you have received a copy of the source:

cd mvp_v1/development && poetry install

This installs approximately 177 packages including litellm, pydantic, textual, fastmcp, fastapi, anthropic, openai, langchain, scikit-learn, and more.

Optional extras

torch, keras, and pymc are optional extras not installed by default. Install per-component as needed:

poetry install --extras torch

pymc requires Python < 3.13 due to its pytensor dependency.

Run tests

python -m pytest tests/ -v

Why python -m pytest?

Running via python -m ensures the pyproject.toml pythonpath configuration is loaded automatically, adding components and bases to the module search path. This avoids ModuleNotFoundError issues.

Start the TUI

python -m mvp.cli

The Textual-based TUI provides a dashboard with 7 tabs including a Components tab showing all registered components from the ComponentRegistry.

Start the REST server

python -m mvp.rest

This launches a FastAPI server on http://localhost:8010 with auto-generated OpenAPI docs at /docs.

Start the MCP server (stdio)

For local development, run the MCP server via stdio transport:

python -m mvp.mcp

Register it with Claude Code:

claude mcp add g6 -- python -m mvp.mcp

stdio vs SSE

Local development uses stdio transport (Claude Code spawns the server process directly). The cloud deployment uses SSE transport over HTTPS. Both expose the same tool set.

Docker (self-hosted)

Each base has a Dockerfile at bases/mvp/<base>/Dockerfile. Launch the full stack:

docker compose up -d

Individual services:

docker build -f bases/mvp/mcp/Dockerfile -t g6-mcp .
docker run -p 8080:8080 g6-mcp
docker build -f bases/mvp/rest/Dockerfile -t g6-rest .
docker run -p 8010:8010 g6-rest
docker build -f bases/mvp/cli/Dockerfile -t g6-cli .
docker run -it g6-cli

Workspace commands

# View workspace info (Polylith)
poetry poly info

# Run linting
python -m ruff check .

# Run type checking
python -m mypy components/ bases/

Windows: poetry poly info exit code

On Windows, poetry poly info exits with code 1 due to a Unicode checkmark rendering issue. The output is still valid -- safe to ignore the non-zero exit code.

Project structure

The Polylith workspace organizes code into three brick types:

mvp_v1/
├── workspace.toml          # Polylith config (namespace=mvp, theme=loose)
├── pyproject.toml           # Root workspace (dev deps)
├── components/mvp/<name>/   # 270 registry component bricks (pure logic)
├── bases/mvp/<name>/        # 14 base bricks (delivery mechanisms)
├── projects/<name>/         # 3 deployable artifacts
├── tests/                   # Test suites
└── development/             # Dev environment (all bricks, package-mode=false)

See Polylith Architecture for details on how bricks compose.

Next steps