Metadata-Version: 2.5
Name: omop-llm
Version: 1.0.1
Summary: LLM interfaces for OMOP
Author-email: Nico Loesch <n.loesch@unsw.edu.au>
License-File: LICENSE
Requires-Python: >=3.12
Requires-Dist: any-llm-sdk[gemini,ollama]<2.0.0,>=1.22.0
Requires-Dist: httpx
Requires-Dist: oa-configurator<2.0.0,>=1.0.0
Requires-Dist: ollama
Requires-Dist: pydantic
Provides-Extra: dev
Requires-Dist: instructor>=1.13.0; extra == 'dev'
Requires-Dist: mkdocs-material; extra == 'dev'
Requires-Dist: mkdocs-mermaid2-plugin; extra == 'dev'
Requires-Dist: mkdocs<2.0; extra == 'dev'
Requires-Dist: mkdocstrings[python]; extra == 'dev'
Requires-Dist: mypy>=1.19.1; extra == 'dev'
Requires-Dist: pytest-asyncio>=1.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=7.0.0; extra == 'dev'
Requires-Dist: pytest>=9.0.2; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Requires-Dist: ty>=0.0.59; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0.12.20250915; extra == 'dev'
Provides-Extra: instructor
Requires-Dist: instructor>=1.13.0; extra == 'instructor'
Description-Content-Type: text/markdown

# omop-llm

Shared chat/embedding backend contract for the OMOP stack, built on [any-llm](https://github.com/mozilla-ai/any-llm). One typed `ModelBackend` interface (sync and async methods, both real), a closed set of supported providers (local: `ollama`, `llamacpp`, `vllm`; cloud: `openai`, `anthropic`, `gemini`), and explicit capability declarations instead of provider-name guessing. Extended documentation can be found [here](https://AustralianCancerDataNetwork.github.io/omop-llm).

```python
from omop_llm import build_model_backend, Capabilities

backend = build_model_backend(
    provider="ollama", model="llama3:8b", base_url="http://localhost:11434",
    model_capabilities=Capabilities(),  # plain chat only -- nothing else needed here
)

# async
response = await backend.async_complete([{"role": "user", "content": "Hello"}])

# sync
response = backend.complete([{"role": "user", "content": "Hello"}])
```

Or resolved from an `oa-configurator` stack config:

```python
from oa_configurator import Resolver, load_stack_config
from omop_llm import build_model_backend_from_resolved

resolved = Resolver(load_stack_config()).resolve_model("embed-default")
backend = build_model_backend_from_resolved(resolved)
```

See [docs/index.md](docs/index.md) for the full design (provider registry, capability model, structured extraction).
