Skip to main content

Matyan Frontier

Ingestion gateway between training clients and the rest of the Matyan stack. Clients connect via WebSocket for metrics, params, and logs, and via REST for presigned URLs (S3, GCS, or Azure Private SAS); the frontier publishes to Kafka. The UI and backend do not talk to the frontier. Part of the Matyan experiment-tracking stack (fork of Aim).

Layout

  • src/matyan_frontier/ — Python package: FastAPI app, WebSocket handler, REST presign endpoint, Kafka producer, config, health, metrics.
  • Entrypoints: app.py (lifespan: start Kafka producer, create blob storage clients, ensure bucket; shutdown: flush producer, close clients).
  • Routes: GET /api/v1/ws/runs/{run_id} (WebSocket), POST /api/v1/rest/artifacts/presign, GET /health/ready/, GET /health/live/, GET /metrics/ (Prometheus).

Prerequisites

  • Python 3.12+. The package uses uv in the repo: uv run matyan-frontier or install then matyan-frontier CLI.
  • Runtime dependencies: Kafka (bootstrap reachable) and an blob store (e.g. RustFS in dev, AWS S3/GCS/Azure Blob Store in prod). The smoke test and local dev assume Kafka and S3 are up (e.g. via docker-compose).

Run (production-like)

From the frontier package directory: uv run matyan-frontier start (or matyan-frontier start if installed).

Options: --host, --port (defaults: 0.0.0.0, 53801). The CLI uses these option defaults; config also defines host/port for other entry points.

Configuration (environment variables)

Variable Default Purpose
MATYAN_ENVIRONMENT / ENVIRONMENT development When production, S3/Kafka must be non-dev (validated at startup).
LOG_LEVEL INFO Log level (loguru + uvicorn).
HOST 0.0.0.0 Bind address.
PORT 53801 Bind port.
KAFKA_BOOTSTRAP_SERVERS localhost:9092 Kafka broker list.
KAFKA_DATA_INGESTION_TOPIC data-ingestion Topic for ingestion messages.
KAFKA_SECURITY_PROTOCOL / KAFKA_SASL_* (empty) Optional Kafka SASL.
BLOB_BACKEND_TYPE s3 Storage backend: s3, gcs, or azure.
S3_ENDPOINT http://localhost:9000 S3 API endpoint (e.g. RustFS).
S3_PUBLIC_ENDPOINT "" Optional; used for presigned URLs if different from S3_ENDPOINT.
S3_ACCESS_KEY / S3_SECRET_KEY (dev defaults) S3 credentials.
S3_BUCKET matyan-artifacts Bucket for artifacts (S3).
S3_REGION us-east-1 S3 region (default: us-east-1).
GCS_BUCKET matyan-artifacts Bucket for artifacts (GCS).
AZURE_CONTAINER matyan-artifacts Container for artifacts (Azure).
AZURE_CONN_STR "" Azure connection string.
AZURE_ACCOUNT_URL "" Azure account URL (for SAS user delegation key).
S3_PRESIGN_EXPIRY 3600 URL/SAS expiry (seconds).
SHUTDOWN_FLUSH_TIMEOUT 5.0 Seconds to wait for Kafka flush on shutdown.
METRICS_ENABLED true Expose Prometheus /metrics/.
CORS_ORIGINS (localhost list) Allowed origins (comma-separated or repeated).

Source of truth: config.py.

Development and smoke test

  • Development: Run Kafka and S3 (e.g. docker compose up kafka kafka-init rustfs or equivalent), then uv run matyan-frontier start. Clients (e.g. matyan-client) point at the frontier URL for WebSocket and presign.
  • Smoke test: From extra/matyan-frontier, run uv run python scripts/smoke_test.py. Prerequisites: Kafka, S3, and frontier running. The script covers WebSocket (create_run, log_metric, log_hparams, finish_run, etc.) and REST presign, and optionally verifies Kafka consumption.

See scripts/smoke_test.py for the exact command and what it checks.

Deployment

The UI talks only to the backend, not to the frontier; the frontier is for training clients.

Related

  • Backend: matyan-backend serves the REST API and consumes from Kafka (ingestion + control workers); it does not receive client traffic from the frontier directly.
  • Client: matyan-client sends tracking data to the frontier (WebSocket + presign REST).
  • Monorepo: This package lives under extra/matyan-frontier in the matyan-core repo.

Metadata

Release files for matyan-frontier 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for matyan-frontier 0.3.0
File Size Uploaded Provenance Actions
matyan_frontier-0.3.0.tar.gz 149.7 kB With provenance Details for matyan_frontier-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for matyan-frontier 0.3.0
File Interpreter ABI Platform Actions
matyan_frontier-0.3.0-py3-none-any.whl Python 3 none any Details for matyan_frontier-0.3.0-py3-none-any.whl

Total release size: 171.8 kB

Release files / matyan_frontier-0.3.0.tar.gz

Download URL matyan_frontier-0.3.0.tar.gz
Size 149.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f85c2c6b25d8f2f2049debd712e9c3dc327485b2ca6ca13f5ad10826b389eecd
BLAKE2b-256 checksum
How to use checksums
d0c12206f0cabe27463928f5aeb4ebb6f24158599d1084124c2eec8227a8189d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Release files / matyan_frontier-0.3.0-py3-none-any.whl

Download URL matyan_frontier-0.3.0-py3-none-any.whl
Size 22.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7cdf50b7d9c2825aa4f12a0b756f9b29cecd1173130c4237b5a05713acf92e1
BLAKE2b-256 checksum
How to use checksums
129be29b5d5ddcdedf9e10da9b2c23bf298dd97ed634f591a39b8af5fa7e3116
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

Security for matyan-frontier 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for matyan_frontier-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page