Service registry for APIPod clients.
Project description
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, andServiceFamilyare Pydantic models. Validated on construction, serializable, no loose dicts. - A registry.
Registryholds 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
ServiceDefinitionwithout 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
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 apipod_registry-0.0.6.tar.gz.
File metadata
- Download URL: apipod_registry-0.0.6.tar.gz
- Upload date:
- Size: 60.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
458d93db97377f29fa49cc3a642291fa7c34fecdc421179238e1a9f9d01e2a14
|
|
| MD5 |
f4a0de95f6cd55fb8de96b7df7654f9f
|
|
| BLAKE2b-256 |
6af5b8f0a656f26a14429a44b19d1015f59fca386918782c60263fdef8cc5e00
|
File details
Details for the file apipod_registry-0.0.6-py3-none-any.whl.
File metadata
- Download URL: apipod_registry-0.0.6-py3-none-any.whl
- Upload date:
- Size: 56.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43d27aa84882783d7ddbb243b93ac8b104a98d260190ae12e5bf1b5b6f4a4716
|
|
| MD5 |
991e2df79177477c3eb8c78f97e0080d
|
|
| BLAKE2b-256 |
4443341500b14c50b81f0c3eed013c7ad385b7d818719d1f5a06217cc853d684
|