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.0.tar.gz (12.9 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.0-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: matyan_api_models-0.2.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for matyan_api_models-0.2.0.tar.gz
Algorithm Hash digest
SHA256 07939b93dad9fb045a51502fa6ad6ce8c2e08426e64e23191739e32e15057119
MD5 e68a6fd6b824793dd1b1f7beb6bedc9c
BLAKE2b-256 4cefe27a2882c500cd771d1de16d6c47551f004bb7ecf06fe0597efec3e03c7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: matyan_api_models-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for matyan_api_models-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c55ec7db54d19b4cd68e9c7abaf9ad8ee8b3929be4fb1461783781f51d2a81a
MD5 88f725e7d20b252959c1c309fc380271
BLAKE2b-256 5bc9e5cfcf3248cf6ca643a4300a02706cf6ab2eaf0c56acbe62eadbc71803cf

See more details on using hashes here.

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