hci-atrium
The Python SDK for the Atrium framework — a multimodal asset library with semantic + cross-modal search and capability routing.
Status: built, in active internal use — auth, library search, external-source search/import, embeddings, chat/streaming/tools, sessions/rooms, surveys, dashboards, and the CLI are all in place. The API may still evolve pre-1.0.
See the bundled GUIDE.md for a complete, task-oriented reference with runnable examples.
Install
uv add hci-atrium # in a uv project
Or pip install hci-atrium.
For coding agents
atrium guide prints the complete, task-oriented SDK guide — the primary way to get the real API
into an agent's context. Tell the agent to run it in your first message ("run atrium guide
and read it before writing any Atrium code"), or pipe it in yourself
(uv run atrium guide > atrium-guide.md). The deployed instance serves the same docs at
/llms.txt for agents that browse.
Say it explicitly each session — agents don't reliably read a standing instruction file on their
own. As a backstop, add these lines to your project's CLAUDE.md / AGENTS.md:
This project uses the hci-atrium SDK. Before writing Atrium code, run
`atrium guide` and follow it — it is the authoritative API reference
(`uv run atrium guide` in Python projects, `pnpm exec atrium guide` in
TypeScript projects).
The npm package ships the same guide behind atrium guide too, so the snippet works in either
ecosystem.
Use
Zero-config — the first call opens a browser to sign in, then later runs are silent:
from hci_atrium import Atrium
client = Atrium() # defaults to the institute instance
for hit in client.library.search("calm rainy afternoon", modality="audio"):
print(round(hit.score, 3), hit.asset.title or hit.asset.filename)
print(" ", hit.asset.content_url)
print(client.me().email)
Configuration
| What | Argument | Environment | Default |
|---|---|---|---|
| Instance URL | Atrium(base_url=…) |
ATRIUM_BASE_URL |
the deployed instance |
| Credential | Atrium(api_key="atr_…") |
ATRIUM_API_KEY |
cached OAuth → browser sign-in |
An API key skips the browser entirely (CI / headless). Otherwise OAuth tokens are cached in
~/.atrium/credentials.json (mode 0600) and refreshed silently.
Projects & collections
Scope a client to a project or collection — either a reusable view or a per-call argument:
photos = client.collection("c_7Bq3Xk") # a scoped view; every call below is scoped
photos.library.search("rain")
photos.assets.list()
client.library.search("rain", project="p_4mD2qX") # or per-call
client = Atrium(project="p_4mD2qX") # or a default for the whole client
A project-scoped API key (atr_… bound to one project) scopes everything automatically.
Direct models
Register a model name that lives at an OpenAI-compatible endpoint (a local Ollama / LM Studio,
or a remote server). Chat/agent calls naming it are sent directly to that endpoint, bypassing
Atrium — while everything else (embeddings, library search, sessions, rooms) still goes to Atrium.
The mental model is local brain, hosted context: the agent reasons on a local model, but its
library.search tool still calls Atrium.
client = Atrium()
client.add_direct_model("gemma3", base_url="http://localhost:11434/v1") # → local Ollama
client.chat("Write a haiku about rain.", model="gemma3") # served locally, bypasses Atrium
client.chat("Write a haiku about rain.", model="gpt-oss") # unregistered → goes to Atrium
# Everything non-LLM still hits Atrium — embeddings never route to a direct endpoint (a stored
# vector's model is a data contract with the library's vector space), even on a name collision.
client.embed("rain on a tin roof", model="clap-fusion")
| Method | Purpose |
|---|---|
Atrium(direct_models={"gemma3": {"base_url": …, "api_key": None}}) |
register at construction |
add_direct_model(name, *, base_url, api_key=None, timeout=None) |
register one name |
add_direct_models(names, *, base_url, api_key=None, timeout=None) |
register a list sharing one endpoint |
remove_direct_model(name) |
stop routing it directly (calls fall back to Atrium) |
list_direct_models() |
audit — {name: DirectEndpoint} |
discover_models(base_url, *, api_key=None) |
read-only GET /models; never registers |
- Explicit per name. Registration is never auto-enumerated — a registered name intentionally
shadows an Atrium model of the same name. Use
discover_modelsto see an endpoint's names, then register the ones you want. - Per-endpoint auth.
api_keyrides the endpoint, shared by every name on it; many local servers need none. The Atrium token is never sent to a direct endpoint. - Timeout. A direct endpoint defaults to the client's
timeout=; raise it per endpoint withadd_direct_model(…, timeout=120)(or a"timeout"in the construction dict) — local models can be slow to return a non-streamed completion. - No silent fallback. An unreachable direct endpoint raises (a connection error /
APIError) — it never quietly falls back to Atrium, which would mask a misconfigured endpoint. - Tool-calling is the endpoint's job.
agent(model=<direct>)works only if the endpoint implements OpenAI function-calling; one that doesn't just never emitstool_calls.
AsyncAtrium has the same surface (discover_models is async).
Playback & capabilities
Every Asset exposes three read-only views that discriminate on capability, not on a
kind string — bytes and link capabilities are independent flags, and an asset can hold both:
asset = client.assets.get("a_123")
asset.capabilities # {"bytes"} / {"link"} / {"bytes", "link"} / set()
asset.link # AssetLink(provider, entity, uri) — present iff "link" ⊆ capabilities
asset.playback.as_signal() # {"source": ..., "ref": ..., "mode": ...} — always present
asset.playback normalizes the asset into a play intent, preferring bytes when both
capabilities hold; it mirrors the room play signal's {source, ref, mode?} shape 1:1, so a
host can forward it as-is. A recognized streaming provider link (currently Spotify) resolves to
its own source ("spotify") and a provider:entity:id ref; an unrecognized link falls back
to source="link" with the raw URL — old SDKs degrade gracefully in front of a provider they
don't know about yet.
Home Assistant bridge
hci_atrium.ha.HomeAssistantBridge runs near your Home Assistant instance, joins a room by
connect code, and declaratively wires room signals to HA services (and HA state back into the
room). websockets (its HA leg) rides along as a core dependency — nothing extra to install:
from hci_atrium import async_join_room
from hci_atrium.ha import HomeAssistantBridge
room = await async_join_room(code)
bridge = (
HomeAssistantBridge(ha_url, ha_token)
.media_sink("media_player.living_room") # play `play` intents; also forwards their state
.on_signal( # any other signal -> any other HA service
"plate.pulse", domain="number", service="set_value",
entity_id="number.plate_intensity", data=lambda p: {"value": p["strength"]},
)
)
await bridge.run(room)
media_sink(...) forwards those entities' state back as media.state by default
(forward_state=False opts out); call forward_state(...) yourself for entities outside the
media sink, or to override the as_type/debounce. atrium ha-bridge wraps the
zero-code standard case (media sink, state-forwarding included) as a CLI — see below.
CLI
Installing the package puts an atrium command on your PATH (or use python -m hci_atrium):
atrium login # sign in (opens a browser)
atrium whoami
atrium search "calm rainy afternoon" --modality audio
atrium assets --modality audio --limit 10
atrium enrich "rain on a tin roof" audio --preview
atrium chat "Write a haiku about rain" --model rwth/gpt-oss-120b
atrium ha-bridge --code ABC123 --ha-url ws://homeassistant.local:8123/api/websocket \
--ha-token *** --media-player media_player.living_room
atrium logout # forget the cached session — sign in again next time
Other runtimes
Because the server is OpenAI-API-compatible, point any OpenAI-compatible client at this instance:
client.base_url # the OpenAI-compatible endpoint
client.token() # a live, auto-refreshed bearer token
Metadata
Release files for hci-atrium 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hci_atrium-0.5.1.tar.gz | 336.2 kB | Without provenance | Details for hci_atrium-0.5.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hci_atrium-0.5.1-py3-none-any.whl | Python 3 | none | any | Details for hci_atrium-0.5.1-py3-none-any.whl |
Total release size: 552.3 kB
Release files / hci_atrium-0.5.1.tar.gz
| Download URL | hci_atrium-0.5.1.tar.gz |
|---|---|
| Size | 336.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7ed205dbe89ddafd4cbd5758ed94077ee02cf1c4452c090ee50ab42a9dac752c
|
|
BLAKE2b-256 checksum How to use checksums |
b51b7c07598d2275a7ed2b6b34b81e098d09def9fc2d7845bdbe9bb56aeb3322
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / hci_atrium-0.5.1-py3-none-any.whl
| Download URL | hci_atrium-0.5.1-py3-none-any.whl |
|---|---|
| Size | 216.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5ee1a9d79a826a7fe0d9e97bdf171997f42e1dcc4b828cd81d2537209cf76ad1
|
|
BLAKE2b-256 checksum How to use checksums |
b186230e473e0f19b268f6eb71fd1ec0fae58b2a446887756c76277b254589aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.18 {"installer":{"name":"uv","version":"0.11.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for hci-atrium 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.