Skip to main content

Service registry for APIPod clients.

Project description

APIPod Registry. The service registry behind the SocAIty SDK.

PyPI version Python versions GitHub License

The service registry behind the SocAIty SDK.

Define AI services as typed Pydantic models, store them anywhere, look them up by id or name.
One source of truth for the FastSDK engine and the socaity wrapper.

What it is

apipod_registry is the definitions and registry layer that the SocAIty SDK runs on. It gives you:

  • Typed definitions. ServiceDefinition, EndpointDefinition, ModelDefinition, ServiceCategory, and ServiceFamily are Pydantic models. Validated on construction, serializable, no loose dicts.
  • A registry. Registry holds services in memory and behaves like a dict. Look up by id or by display name, both resolve to the same typed object.
  • Pluggable storage. Pass a store (Supabase, Postgres, filesystem) and the registry persists and loads for you. Leave it out to stay fully in memory.
  • Parsers. Turn an OpenAPI, FastTaskAPI, or Cog schema into a ServiceDefinition without writing it by hand.

Install

pip install apipod_registry

Python 3.8 or newer.

Quick start

Create a registry, add a service, get it back typed:

from apipod_registry import Registry, ServiceDefinition, EndpointDefinition

reg = Registry()

reg.add_service(ServiceDefinition(
    id="flux-schnell",
    display_name="Flux Schnell",
    specification="replicate",
    endpoints=[EndpointDefinition(id="predict", path="/predict", method="POST")],
))

svc = reg.get_service("flux-schnell")   # by id
svc = reg.get_service("Flux Schnell")   # or by display name, same object
ep = reg.get_endpoint("flux-schnell", "/predict")

The registry is dict-like: reg["flux-schnell"], len(reg), and for service_id in reg all work. list_services(), filter_services(**attrs), get_services_by_family(...), and get_services_by_category(...) cover lookups across the set.

Persisting to a store

Pass an IServiceRegistry backend and the registry loads on init and saves on write. A Supabase helper ships in the box:

from apipod_registry import create_service_registry_with_supabase

reg = create_service_registry_with_supabase()   # reads SUPABASE_URL / SUPABASE_KEY
reg.add_service(my_service)                      # persisted, not just in memory

Postgres and filesystem stores live under apipod_registry.service_registry. Implement IServiceRegistry to back the registry with anything else.

License

GPLv3. See LICENSE.

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

apipod_registry-0.0.7.tar.gz (61.3 kB view details)

Uploaded Source

Built Distribution

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

apipod_registry-0.0.7-py3-none-any.whl (57.1 kB view details)

Uploaded Python 3

File details

Details for the file apipod_registry-0.0.7.tar.gz.

File metadata

  • Download URL: apipod_registry-0.0.7.tar.gz
  • Upload date:
  • Size: 61.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for apipod_registry-0.0.7.tar.gz
Algorithm Hash digest
SHA256 7a9d0ae3a53bcc2d37de41d67224275cc3ee4b95eaa642a7525b0f19af9f7bc7
MD5 b7f321b6bf1d03189785f89a7120da80
BLAKE2b-256 aab19c144e49a6a2a2c5efbc0261f60be2b3afe1662dfd875476258c0dd136e2

See more details on using hashes here.

File details

Details for the file apipod_registry-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for apipod_registry-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 778d70fa969985af00a2cb9c415a23409194f1d9a60ef04b3fad7744a45a8907
MD5 92c31f57b5224ffdd89c53ad2852b088
BLAKE2b-256 13c137926c5862842cf2cc2cdd261ca618be4ef56e20f82a6d2002173510f116

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