Production infrastructure for HyperCycle AIMs — telemetry, retries, health, and inter-AIM routing.
Project description
qyra
Production infrastructure for HyperCycle AIMs.
qyra is a small, dependable toolkit for building, instrumenting, and operating
AI Microservices on the HyperCycle network. It gives you four things that every
production AIM needs and that you'd otherwise re-implement: telemetry, retries,
health endpoints, and inter-AIM routing.
Why qyra
If you're building an AIM today, you're probably writing the same handful of boilerplate every time:
- A
try/exceptaround every model call to log latency and tokens. - An ad-hoc retry loop when the next-hop AIM hiccups.
/healthand/readyendpoints copy-pasted from your last service.- A homegrown HTTP client with timeouts you tune by trial and error.
qyra standardises this so you can focus on what your AIM actually does.
Install
pip install qyra
For FastAPI integration (recommended):
pip install 'qyra[fastapi]'
30-second quickstart
from fastapi import FastAPI
from qyra import attach_health_endpoints, instrument, track
app = FastAPI()
attach_health_endpoints(app, aim_name="my-aim", aim_version="0.1.0")
@app.post("/ask")
@instrument(operation="ask")
async def ask(payload: dict):
# your model call here
response = call_my_model(payload["question"])
track("ask", response, aim_name="my-aim")
return {"answer": response.text}
That's it. Every call to /ask now reports latency, success/failure, model,
and token usage to your telemetry endpoint. /health, /ready, and /metrics
exist automatically.
Configuration
qyra is environment-driven. The most common variables:
| Variable | Purpose |
|---|---|
QYRA_TELEMETRY_URL |
Where to POST telemetry events. |
QYRA_API_KEY |
API key sent in the X-Qyra-Api-Key header. |
QYRA_AIM_NAME |
Default AIM name when not passed to a call. |
QYRA_DISABLED |
Set to 1 to silence telemetry (useful in tests). |
Full list: see src/qyra/config.py.
Inter-AIM calls
qyra.AsyncClient (and qyra.Client) wrap httpx with retries, timeouts,
and automatic telemetry:
from qyra import AsyncClient
async def fetch_news():
async with AsyncClient("aim-web-research", base_url="http://127.0.0.1:8087") as c:
resp = await c.post("/research", json={"query": "HyperCycle"})
return resp.json()
Failed calls are retried with exponential backoff. Every call — successful or not — emits a telemetry event tagged with the operation name.
What qyra is not
- Not a competing AIM marketplace. It plays well with HMS, HyperCycle's own marketplace.
- Not a node-operator certification. That's HyperCycle's 88.88 Certification — we operate at the AIM layer, not the node layer.
- Not magic. It's a thin layer over
httpxand FastAPI. Read the source.
License
Apache 2.0 — see LICENSE.
Status
This is an alpha release (0.1.0). The public API may shift before 1.0. We use semantic versioning from 1.0 onward.
Built by Qyratech for the HyperCycle ecosystem.
Project details
Release history Release notifications | RSS feed
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 qyra-0.1.0.tar.gz.
File metadata
- Download URL: qyra-0.1.0.tar.gz
- Upload date:
- Size: 16.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ac9e9838b265a90611e37b477d73c11754010fa1cacbb0ebf8be98653ba6e71
|
|
| MD5 |
198b7556c4f1261b93a54c7b2d3598eb
|
|
| BLAKE2b-256 |
6563c1b46a7ce47022a1d596ee0face22231dfb4c7f01bc4c780a52020492368
|
File details
Details for the file qyra-0.1.0-py3-none-any.whl.
File metadata
- Download URL: qyra-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac3ddd8310ac504df5e1ece087e2e9be81608c79b3847b55ab2adfe025d5f458
|
|
| MD5 |
334b567e7b08b0741946bafad54b7d37
|
|
| BLAKE2b-256 |
7538bc10808cd2f30dfbae6f24a53166dd086e0a23bd4946c6df377199638380
|