AbstractGateway: deployable Run Gateway host for AbstractRuntime (commands + ledger).
Project description
AbstractGateway
AbstractGateway is a deployable Run Gateway host for AbstractRuntime runs:
- start durable runs
- accept a durable command inbox
- replay/stream a durable ledger (replay-first)
- enforce a security baseline (token + origin allowlist + limits)
This decouples the gateway service from any specific UI (AbstractFlow, AbstractCode, web/PWA thin clients).
Start here: docs/getting-started.md
AbstractFramework ecosystem
AbstractGateway is part of the AbstractFramework ecosystem:
- AbstractRuntime (required): durable run model + workflow registry + stores (
pyproject.toml,src/abstractgateway/runner.py) - AbstractCore (optional, via
abstractruntime[abstractcore]/abstractruntime[multimodal]): LLM/tool execution, provider-level prompt-cache controls, and workflow-backed generated image/voice/audio capabilities used by many bundles (src/abstractgateway/hosts/bundle_host.py) - Higher-level UIs (optional): AbstractFlow (authoring/bundling), AbstractCode / AbstractObserver / thin clients (rendering + operations)
Related repos:
- AbstractFramework: https://github.com/lpalbou/AbstractFramework
- AbstractCore: https://github.com/lpalbou/abstractcore
- AbstractRuntime: https://github.com/lpalbou/abstractruntime
Quickstart (HTTP server, bundle mode)
pip install "abstractgateway[http]"
export ABSTRACTGATEWAY_FLOWS_DIR="/path/to/bundles" # *.flow dir (or a single .flow file)
export ABSTRACTGATEWAY_DATA_DIR="$PWD/runtime/gateway"
# Required by default: the server refuses to start without a token.
export ABSTRACTGATEWAY_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
# Browser-origin allowlist (glob patterns). Default allows localhost; customize when exposing remotely.
export ABSTRACTGATEWAY_ALLOWED_ORIGINS="http://localhost:*,http://127.0.0.1:*"
abstractgateway serve --host 127.0.0.1 --port 8080
OpenAPI docs (Swagger UI): http://127.0.0.1:8080/docs
Smoke checks:
curl -sS "http://127.0.0.1:8080/api/health"
curl -sS -H "Authorization: Bearer $ABSTRACTGATEWAY_AUTH_TOKEN" \
"http://127.0.0.1:8080/api/gateway/bundles"
Docker server
Release images are published to GHCR:
docker pull ghcr.io/lpalbou/abstractgateway-server:0.2.2
The image installs abstractgateway[server]: HTTP server,
AbstractRuntime[multimodal], AbstractCore remote/commercial provider support,
OpenAI-compatible text providers, workflow-backed image generation through
AbstractVision, direct Gateway voice/audio endpoints through AbstractVoice,
prompt-cache helpers, media/tool helpers, token counting, compression,
AbstractAgent, and AbstractFlow compatibility.
export ABSTRACTGATEWAY_AUTH_TOKEN="$(python -c 'import secrets; print(secrets.token_urlsafe(32))')"
docker run --rm --name abstractgateway-server \
-p 127.0.0.1:8080:8080 \
-e ABSTRACTGATEWAY_AUTH_TOKEN="$ABSTRACTGATEWAY_AUTH_TOKEN" \
-e ABSTRACTGATEWAY_PROVIDER="openai-compatible" \
-e ABSTRACTGATEWAY_MODEL="your-model" \
-e OPENAI_COMPATIBLE_BASE_URL="http://host.docker.internal:1234/v1" \
-v "$PWD/runtime/gateway:/data/gateway" \
-v "$PWD/flows/bundles:/data/flows:ro" \
ghcr.io/lpalbou/abstractgateway-server:0.2.2
Compose and deployment details: docs/deployment.md.
0.2.2 capability scope
Direct Gateway APIs in this release:
POST /api/gateway/runs/{run_id}/voice/ttsPOST /api/gateway/runs/{run_id}/audio/transcribe/api/gateway/prompt_cache/*provider/model operator controls/api/gateway/discovery/capabilitiespackage and plugin discovery
Workflow/Core-backed capabilities:
- Generated images are available to Runtime/Core workflows through AbstractVision when installed and configured.
- Gateway does not yet expose a direct
/images/generate-style HTTP endpoint. - Prompt-cache support depends on the active provider/model and is not a full Gateway-owned CachedSession lifecycle API.
Client contract (replay-first)
- Clients start runs:
POST /api/gateway/runs/start - Clients can schedule runs (bundle mode):
POST /api/gateway/runs/schedule - Clients act by submitting durable commands:
POST /api/gateway/commands- supported types:
pause|resume|cancel|emit_event|update_schedule|compact_memory
- supported types:
- Clients render by replaying/streaming the durable ledger:
- replay:
GET /api/gateway/runs/{run_id}/ledger?after=... - stream (SSE):
GET /api/gateway/runs/{run_id}/ledger/stream?after=...
- replay:
See docs/api.md for curl examples and the live OpenAPI spec (/openapi.json).
Install
Base (runner + stores + CLI)
Requires Python >=3.10 (see pyproject.toml).
pip install abstractgateway
HTTP API/SSE server (FastAPI + Uvicorn)
pip install "abstractgateway[http]"
Optional extras
abstractgateway[visualflow]: run VisualFlow JSON from a directory of*.jsonfiles (requiresabstractflow)abstractgateway[server]: container/server profile with AbstractRuntime multimodal support, AbstractCore remote providers, OpenAI-compatible text providers, workflow-backed AbstractVision image generation, direct Gateway voice/audio endpoints, media/tool helpers, tokens, and compressionabstractgateway[telegram]: Telegram bridge dependenciesabstractgateway[voice]: enable voice/audio endpoints (TTS/STT) via AbstractVoice and AbstractCore's voice/audio plugin extrasabstractgateway[vision]: enable generative vision via AbstractCore's AbstractVision pluginabstractgateway[multimodal]: Runtime/Core multimodal profile without the HTTP server depsabstractgateway[all]: batteries-included install (HTTP + tools + voice/audio + vision + media + visualflow)abstractgateway[docs]: MkDocs site toolingabstractgateway[dev]: local test/dev deps
Bundle-dependent dependencies (only if your workflows need them)
- LLM/tool nodes in bundle mode require AbstractRuntime’s AbstractCore integration.
- If you installed
abstractgateway[http], this is already included. - If you installed only the base package, install it explicitly:
- If you installed
pip install "abstractruntime[abstractcore]>=0.4.6"
Visual Agent nodes require abstractagent (also included by abstractgateway[http]):
pip install abstractagent
For details on ABSTRACTGATEWAY_PROVIDER/MODEL, store backends, and workflow sources, see docs/configuration.md.
Creating a .flow bundle (authoring)
Use AbstractFlow to pack a bundle:
abstractflow bundle pack /path/to/root.json --out /path/to/bundles/my.flow --flows-dir /path/to/flows
See docs/getting-started.md for running, split API/runner, and file→SQLite migration.
Docs
Published docs site: https://www.lpalbou.info/AbstractGateway/
Project docs
- Changelog: CHANGELOG.md (compat:
CHANGELOD.md) - Contributing: CONTRIBUTING.md
- Security policy (vulnerability reporting): SECURITY.md
- Acknowledgments: ACKNOWLEDGMENTS.md (compat:
ACKNOWLEDMENTS.md)
Package docs
- Docs index: docs/README.md
- Getting started: docs/getting-started.md
- FAQ: docs/faq.md
- Architecture: docs/architecture.md
- Configuration: docs/configuration.md
- Deployment: docs/deployment.md
- API overview: docs/api.md
- Security: docs/security.md
- Operator tooling (optional): docs/maintenance.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file abstractgateway-0.2.2.tar.gz.
File metadata
- Download URL: abstractgateway-0.2.2.tar.gz
- Upload date:
- Size: 366.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75cd78e49fe12c8010d6352a913c75f39f6454dcea25e04041db913ea745592c
|
|
| MD5 |
77c5740df5e4a71e84b45ee1ba062fb1
|
|
| BLAKE2b-256 |
010110d6236b15f5b2de6890079621db81a1f0a076dd4fee4ec7be5c34072290
|
Provenance
The following attestation bundles were made for abstractgateway-0.2.2.tar.gz:
Publisher:
release.yml on lpalbou/AbstractGateway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractgateway-0.2.2.tar.gz -
Subject digest:
75cd78e49fe12c8010d6352a913c75f39f6454dcea25e04041db913ea745592c - Sigstore transparency entry: 1463620604
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractGateway@f9841bce2b0990adee6f941c7059a641bca419e8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f9841bce2b0990adee6f941c7059a641bca419e8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file abstractgateway-0.2.2-py3-none-any.whl.
File metadata
- Download URL: abstractgateway-0.2.2-py3-none-any.whl
- Upload date:
- Size: 238.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65d0a0db46c5c980f1e97cf78856136640eb65f78f9b184d6de106ad1356db59
|
|
| MD5 |
67a4b3bf9cf568d04a4325fc3ebe79bf
|
|
| BLAKE2b-256 |
bbb800b052c9357a24e21e3b097868ad3b862fa857b6cfc287b9fae299c8f96b
|
Provenance
The following attestation bundles were made for abstractgateway-0.2.2-py3-none-any.whl:
Publisher:
release.yml on lpalbou/AbstractGateway
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
abstractgateway-0.2.2-py3-none-any.whl -
Subject digest:
65d0a0db46c5c980f1e97cf78856136640eb65f78f9b184d6de106ad1356db59 - Sigstore transparency entry: 1463620707
- Sigstore integration time:
-
Permalink:
lpalbou/AbstractGateway@f9841bce2b0990adee6f941c7059a641bca419e8 -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/lpalbou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@f9841bce2b0990adee6f941c7059a641bca419e8 -
Trigger Event:
push
-
Statement type: