musubi-livekit
musubi-livekit connects a LiveKit voice session's callbacks to the Musubi
memory API. It provides a LiveKitAdapter, a slow prefetcher, a fast context
reader, a bounded cache, optional fact capture, and transcript handling. The
package is a Python library: your LiveKit worker still owns the session,
event subscriptions, credentials, and user-facing responses.
Install
Requires Python 3.12 or later. The adapter depends on the standalone
musubi-sdk client, not the Musubi server.
The SDK is installed from PyPI as a dependency:
pip install 'git+https://github.com/sourceblender/musubi-livekit.git'
The plugin itself is not published to PyPI yet; the GitHub install above is the current supported install path.
Use in a worker
Construct one adapter per voice session. Feed it the transcript and session events from your own LiveKit worker. These are callbacks to wire into the worker, not an automatically installed LiveKit plugin.
from musubi_sdk import AsyncMusubiClient
from musubi_livekit import LiveKitAdapter, LiveKitAdapterConfig
client = AsyncMusubiClient(base_url=api_url, token=token)
adapter = LiveKitAdapter(
client=client,
namespace="assistant/voice/episodic",
artifact_namespace="assistant/voice/artifact",
config=LiveKitAdapterConfig(
capture_transcripts=False,
capture_facts=False,
),
)
# Call from the matching LiveKit worker events:
await adapter.on_transcript_segment(partial_text)
await adapter.on_user_turn_completed(final_text)
context = await adapter.fast_talker.get_context(final_text)
warnings = adapter.retrieval_status
await adapter.on_session_end(session_id=session_id, vtt_transcript=vtt_text)
Fact and transcript capture are enabled in the default config. Set the privacy
flags deliberately for your application before handling a real session.
retrieval_status exposes degradation warnings so the worker can tell the
user when memory is unavailable. A successful callback call is not a guarantee
that a transcript reached artifact storage: until the SDK has artifacts.upload,
the adapter falls back to episodic capture. See the code and tests before
promising artifact storage or delivery guarantees.
Development
uv sync --locked --python 3.12
uv run pytest -q
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src/musubi_livekit
The unit suite exercises the extracted adapter and retrieval degradation channel. Three historical tests remain skipped because they require a running Musubi stack and a LiveKit session simulator; they are not release evidence.
Five integration tests exercise the adapter through the real Musubi SDK and API. They write memories and thoughts, so point them only at a disposable test stack with an operator-scoped test token:
MUSUBI_TEST_API_URL=http://127.0.0.1:8100/v1 \
MUSUBI_TEST_TOKEN=<disposable-test-token> \
uv run pytest -q -m integration tests/integration/test_livekit_e2e.py
The default test command excludes these integration tests. Their fixture skips when either variable is missing. Linux CI also runs them against Musubi's disposable Docker integration stack; the pinned TEI test image has no ARM64 manifest, so that stack does not boot natively on Apple Silicon.
Contributing and security
Discuss substantial changes in an issue first. Follow the Sourceblender contributing guide. Report security issues privately through the repository Security tab or the organization policy.
Licensed under Apache-2.0. See LICENSE.
Metadata
Release files for musubi-livekit 0.1.0
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 |
|---|---|---|---|---|
| musubi_livekit-0.1.0.tar.gz | 52.6 kB | Without provenance | Details for musubi_livekit-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| musubi_livekit-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for musubi_livekit-0.1.0-py3-none-any.whl |
Total release size: 70.8 kB
Release files / musubi_livekit-0.1.0.tar.gz
| Download URL | musubi_livekit-0.1.0.tar.gz |
|---|---|
| Size | 52.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8746cf0edd037df946827fdffdd3e1d2563785f3fef0acfcfb0d0c9f0b1e58c7
|
|
BLAKE2b-256 checksum How to use checksums |
c1f94d925a7207371e2aedf4264a02ee9dc017cf1142c2313b4d10c6ce4c1184
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / musubi_livekit-0.1.0-py3-none-any.whl
| Download URL | musubi_livekit-0.1.0-py3-none-any.whl |
|---|---|
| Size | 18.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
da76c7f7f9dc4414f1fcef02fe9239c7f6f0fbf5ecb2ee7b2838ee30987e602c
|
|
BLAKE2b-256 checksum How to use checksums |
6b56e8fc7e85a2694974edf552cc36a81ecba81d7dc9658e233bb1395f2b1870
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for musubi-livekit 0.1.0
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.