Metadata-Version: 2.4
Name: pyorla
Version: 1.0.1
Summary: Python SDK for Orla
Keywords: orla,llm,agent,langchain,langgraph,inference
Author: Hayder Tirmazi
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: httpx>=0.28.1
Requires-Dist: langchain-core>=1.2.20
Requires-Dist: langgraph>=1.1.3
Requires-Dist: pydantic>=2.12.5
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/harvard-cns/orla
Project-URL: Documentation, https://orlaserver.github.io/#/docs/pyorla
Project-URL: Repository, https://github.com/harvard-cns/orla
Project-URL: Issues, https://github.com/harvard-cns/orla/issues
Description-Content-Type: text/markdown

# pyorla

Python SDK for [Orla](https://github.com/harvard-cns/orla).

## Install

From [PyPI](https://pypi.org/project/pyorla/) (recommended):

```bash
pip install pyorla
```

Or with uv:

```bash
uv add pyorla
```

The SDK talks to a running `orla serve` daemon over HTTP. Install the Orla binary separately (see the [docs](https://orlaserver.github.io/#/docs/getting-started) for Homebrew, the install script, or Docker).

### Developing pyorla

From a clone of the Orla repo, in the `pyorla` directory:

```bash
uv sync
```

Run checks: `uv run ty check` and `uv run pytest`.

### Releasing to PyPI

1. Bump `version` in `pyproject.toml`.
2. Commit and push a tag: `pyorla-vX.Y.Z` (must match the version in `pyproject.toml`).
3. The [pyorla-publish](https://github.com/harvard-cns/orla/blob/main/.github/workflows/pyorla-publish.yml) workflow builds and uploads to PyPI via [trusted publishing](https://docs.pypi.org/trusted-publishers/).

## Remote server

Point `OrlaClient` at a running daemon:

```python
from pyorla import OrlaClient

client = OrlaClient("https://orla.example.com")
client.health()
```

Register backends and run workflows / `Stage` / `ChatOrla` as in the package examples.

## Local server from Python

For development or notebooks, you can spawn `orla serve` on loopback and get a client back (requires the `orla` CLI on `PATH` or `ORLA_BIN`):

```python
from pyorla import orla_runtime

with orla_runtime() as client:
    client.health()
    # register backends, run execute, etc.
```

This starts a subprocess (`orla serve --listen-address 127.0.0.1:<ephemeral-port>`), waits for `/api/v1/health`, then terminates the process when the block exits.

## Colab and remote notebooks

Colab cannot see `localhost` on your laptop. Use either:

- An Orla daemon on a **public URL** (VM, Kubernetes, tunnel), and pass that URL to `OrlaClient`, or
- A **tunnel** (ngrok, Cloudflare Tunnel, etc.) from the machine where `orla serve` runs to a URL you paste into the notebook.
