Metadata-Version: 2.5
Name: livekit-plugins-alkove
Version: 0.2.0
Summary: Alkove for LiveKit Agents: Focus keeps the user's voice (noise cancellation), Cue finds speech (VAD), on the agent's CPU
Project-URL: Homepage, https://alkove.ai
Project-URL: Repository, https://github.com/alkove-ai/alkove
Author: Eddy Bordi
License-Expression: Apache-2.0
License-File: LICENSE
License-File: NOTICE
Keywords: livekit,noise-cancellation,on-device,vad,voice,voice-agent,voice-isolation
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
Requires-Python: >=3.10
Requires-Dist: alkove<0.3,>=0.2
Requires-Dist: livekit-agents<2,>=1.8.8
Requires-Dist: numpy>=1.21
Description-Content-Type: text/markdown

# livekit-plugins-alkove

[Alkove](https://alkove.ai) for [LiveKit Agents](https://docs.livekit.io/agents/): Focus keeps the user's voice and removes the others and the noise, Cue finds where they speak. Both run on the agent's CPU, with no server and no key, with the chain and the speech rules of Alkove's web SDK.

## Install

```sh
pip install livekit-plugins-alkove
python my_agent.py download-files     # Focus and Cue into the cache, checked by their sha256
```

## Use

```python
from livekit.agents import AgentSession, room_io
from livekit.plugins import alkove

session = AgentSession(vad=alkove.VAD.load(), ...)
await session.start(
    agent,
    room=ctx.room,
    room_options=room_io.RoomOptions(
        audio_input=room_io.AudioInputOptions(noise_cancellation=alkove.Focus()),
    ),
)
```

- **`alkove.Focus()`** is a `rtc.FrameProcessor`. It keeps the closest voice, or with `voiceprint=` the voice of that print; `strength=` and `normalize=` work as in the web SDK. It works at the session's sample rate (24 kHz by default) and gives each frame back at the size it came in, 20 ms behind: whole 10 ms frames, as LiveKit's gain control needs. The models are read from the cache `download-files` filled when it is created.
- **`alkove.VAD.load()`** gives one speech probability every 30 ms, with `speech=alkove.SpeechParams(confidence=0.5, exit_confidence=0.1, start_secs=0.2, stop_secs=0.6)` by default. It counts as the turn detector's `min_silence_duration` (`stop_secs`). Behind `Focus`, it hears only the user.

The models are loaded once per process and shared by every session. Pass `models=alkove.Models.load(["focus", "cue"], dir=...)` to read them from your own folder.

Tested with livekit-agents 1.8.8.

## License

Apache-2.0. See [NOTICE](./NOTICE).
