Skip to main content

Models for the Matyan API

Project description

Matyan API Models

Shared Pydantic models for the Matyan stack. Used by matyan-frontier (WebSocket + Kafka producer), matyan-backend (Kafka consumers, API), and matyan-client (WebSocket and REST client). Part of the Matyan experiment-tracking stack (fork of Aim).

Layout

  • src/matyan_api_models/ — Python package. No CLI or server; import as a library.
  • ws/ — WebSocket request and response models: CreateRunWsRequest, LogMetricWsRequest, LogHParamsWsRequest, FinishRunWsRequest, SetRunPropertyWsRequest, AddTagWsRequest, RemoveTagWsRequest, LogCustomObjectWsRequest, LogTerminalLineWsRequest, LogRecordWsRequest, BlobRefWsRequest, WsRequestTAdapter, WsResponse.
  • kafka/ — Kafka message models: IngestionMessage (envelope for the data-ingestion topic), ControlEvent (for the control-events topic).
  • RootRunCreateRequest, RunCreateResponse; LogHParamsResponse, LogMetricResponse, ReadMetricResponse.

Source of truth for the wire format between frontier, backend, and client.

Prerequisites

  • Python 3.10+. Single dependency: pydantic~=2.0. The monorepo uses uv; from the package dir: uv sync then import matyan_api_models.

Usage

Install as a dependency (editable in the monorepo):

# From repo root or extra/matyan-api-models
uv sync

Then in Python:

from matyan_api_models.ws import CreateRunWsRequest, WsResponse
from matyan_api_models.kafka import IngestionMessage
from matyan_api_models import RunCreateRequest, RunCreateResponse

Frontier validates WebSocket payloads with WsRequestTAdapter and publishes IngestionMessage to Kafka; backend workers consume IngestionMessage and ControlEvent; the client builds WS requests from these models.

Related

  • Frontier: Accepts WebSocket messages and REST run-creation; produces IngestionMessage to Kafka.
  • Backend: Consumes IngestionMessage and ControlEvent; uses run-creation and response models for REST.
  • Client: Builds WebSocket requests and run-creation requests from these models.
  • Monorepo: This package lives under extra/matyan-api-models in the matyan-core repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

matyan_api_models-0.2.1.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

matyan_api_models-0.2.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file matyan_api_models-0.2.1.tar.gz.

File metadata

  • Download URL: matyan_api_models-0.2.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for matyan_api_models-0.2.1.tar.gz
Algorithm Hash digest
SHA256 56a4f7a9b83e353658eb609ad94151873f1926d64dd665e94d301d9200ffa54e
MD5 af96ba60ee2e6ef865fe9733dbcf5d6d
BLAKE2b-256 0388acad7c68575673f8e9e4fad0df446e7024fd8a138a01cc6598e0998d97df

See more details on using hashes here.

Provenance

The following attestation bundles were made for matyan_api_models-0.2.1.tar.gz:

Publisher: release.yml on 4gt-104/matyan-api-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file matyan_api_models-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for matyan_api_models-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ee288d49f056bc071d8345aa4c8d68fcdc76eb0a7cd959819821e7ef87179c5
MD5 b86d22321390b2cee04aada76255311e
BLAKE2b-256 c88596a8eec89d14996ef5db409b4c735fd2cc466f9499282926260f66962666

See more details on using hashes here.

Provenance

The following attestation bundles were made for matyan_api_models-0.2.1-py3-none-any.whl:

Publisher: release.yml on 4gt-104/matyan-api-models

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page