Metadata-Version: 2.4
Name: qyra
Version: 0.1.6
Summary: Production infrastructure for HyperCycle AIMs — telemetry, retries, health, and inter-AIM routing.
Project-URL: Homepage, https://github.com/qyratech/qyra
Project-URL: Documentation, https://github.com/qyratech/qyra#readme
Project-URL: Repository, https://github.com/qyratech/qyra
Project-URL: Issues, https://github.com/qyratech/qyra/issues
Project-URL: Changelog, https://github.com/qyratech/qyra/blob/main/CHANGELOG.md
Author-email: Qyratech <info@qyrafund.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: aim,fastapi,hypercycle,ioai,observability,telemetry
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Requires-Python: >=3.10
Requires-Dist: httpx<1.0,>=0.27.0
Provides-Extra: dev
Requires-Dist: build>=1.0.0; extra == 'dev'
Requires-Dist: mypy>=1.8.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-httpx>=0.30.0; extra == 'dev'
Requires-Dist: pytest>=7.4.0; extra == 'dev'
Requires-Dist: ruff>=0.6.0; extra == 'dev'
Requires-Dist: twine>=5.0.0; extra == 'dev'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
Description-Content-Type: text/markdown

# qyra

**Python SDK for the Qyra AI infrastructure layer.**

Qyra runs production AI Modules (AIMs) on the [HyperCycle](https://hypercycle.ai) network — covering scoring, routing, research, document intelligence, personal memory, benchmarking, telemetry, and certification. This SDK lets you call any AIM, track costs, and log telemetry from your own Python code or agent pipelines.

---

## Installation

```bash
pip install qyra
```

## Quick start

```python
from qyra import QyraClient

client = QyraClient(base_url="https://api.qyratech.com")

# Call an AIM
result = client.call("aim-smart-router", {"query": "Summarise this document", "payload": "..."})
print(result)

# Track a call with telemetry
client.track(
    aim_id="aim-smart-router",
    latency_ms=142,
    cost_usd=0.0028,
    status="success"
)
```

## Telemetry

The SDK ships with a built-in telemetry client that posts structured call data to `qyra-ingest`. Every call can log latency, cost, model used, and outcome — visible in real time on the Qyra dashboard.

```python
from qyra.telemetry import TelemetryClient

tel = TelemetryClient(ingest_url="https://api.qyratech.com/ingest")
tel.track(aim_id="aim-scoring", latency_ms=88, cost_usd=0.0086, status="success")
```

## Production AIMs

| AIM | Description | Cost/call |
|-----|-------------|-----------|
| `aim-scoring` | Survival scoring and ΩSCORE modelling | $0.0086 |
| `aim-smart-router` | Intelligent multi-AIM routing | $0.0028 |
| `aim-personal-memory` | Persistent memory across sessions | $0.0015 |
| `aim-web-research` | Autonomous web research | — |
| `aim-smart-document` | Document intelligence and extraction | — |
| `aim-benchmarker-v2` | Empirical cost/quality benchmarking | — |
| `aim-certification` | AIM quality certification | — |
| `aim-ingest` | Telemetry ingest service | — |

## Links

- **Website:** [qyratech.com](https://qyratech.com)
- **Book a call:** [cal.eu/qyratech/discovery](https://cal.eu/qyratech/discovery)
- **GitHub:** [github.com/qyrahub](https://github.com/qyrahub)

## Changelog

### v0.1.5
- Corrected telemetry ingest URL
- Server-side UUID fallback for older clients
- Real cost derivation in aggregate endpoint

### v0.1.2
- Fixed telemetry URL pointing to production ingest
- P50/P95/P99 latency percentiles in dashboard

### v0.1.0
- Initial release
- `QyraClient` with AIM call support
- Telemetry client with structured logging

---

Built in South Africa. Infrastructure for the agentic age.
