Skip to content

hibira 0.1.0: Python SDK with LLM streaming - #1

Merged
deflinhec merged 2 commits into
mainfrom
claude/project-thread-41jdmz
Nov 1, 2026
Merged

deflinhec merged 2 commits into
mainfrom
claude/project-thread-41jdmz

Conversation

@deflinhec

Copy link
Copy Markdown
Member

First release of hibira on PyPI: the Python server library for Hibira.

What's in it

  • Client / AsyncClient (httpx; Python 3.9+): trigger, trigger_batch, channels, channel_info, users, terminate_user_connections, settings from HIBIRA_* env vars (same names as the Rails gem).
  • authenticate_channel, authenticate_user, verify_webhook (no network, sync on both clients).
  • Hibira Push: push_to_interests, push_to_users, push_token, delete_push_user.
  • Approvals: request_approval, get_approval(wait=), wait_for_approval.
  • stream_to_channel / astream_to_channel: same ai-stream wire format as streamToChannel in @hibira-io/react and @hibira-io/vue (batching, max_bytes 3500, meta on the first event, final event with text when it fits, errors and cancellation sent as error). text_of handles OpenAI chat/Responses, Anthropic, the OpenAI Agents SDK, LangChain/LangGraph stream_mode="messages" and Gemini chunks.
  • hibira.fastapi: auth_router (channel and user auth endpoints for pusher-js) and a webhook dependency.
  • CI (lint, mypy, tests on 3.9 to 3.13, build) and publish.yml (tag vX.Y.Z → PyPI via trusted publishing, environment pypi).

Testing

  • 43 unit tests, passing on Python 3.9 and 3.13; ruff and mypy --strict clean; twine check passes.
  • Signing checked against Pusher's published reference signatures.
  • tests/test_e2e.py (5 tests, HIBIRA_E2E=1) passes against a local pusher-server: trigger, batch, socket exclusion, channel queries, presence users, 401/413 errors, sync and async streaming, and replay of a finished stream through pusher:rewind.
  • Cross-checked with the JS side: a Python stream rebuilt by createStreamStore + followStream from @hibira-io/react (live and with rewind: true) gives the same text and meta.

Before publishing

Add a PyPI pending publisher: project hibira, repo hibira-io/python, workflow publish.yml, environment pypi. Then tag v0.1.0.


Generated by Claude Code

Client and AsyncClient for the Hibira HTTP API (trigger, batch, channel
queries, terminate connections), channel and user auth, webhook
verification, Hibira Push (interests, users, user tokens), approvals,
and stream_to_channel / astream_to_channel for streaming LLM output to
useStream() in @hibira-io/react and @hibira-io/vue. text_of reads
OpenAI, Anthropic, OpenAI Agents SDK, LangChain/LangGraph and Gemini
chunks. hibira.fastapi adds an auth router and a webhook dependency.

Tested on Python 3.9 and 3.13, end to end against pusher-server
(including channel history replay into the JS stream store).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCCHwKcFDPRqugEWRfU
…ntu-latest)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SHtsCCHwKcFDPRqugEWRfU
@deflinhec
deflinhec marked this pull request as ready for review November 1, 2026 14:43
@deflinhec
deflinhec merged commit 97bd757 into main Nov 1, 2026
2 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants