Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions livekit-plugins/livekit-plugins-personaplex/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# LiveKit Plugins PersonaPlex

Agent Framework plugin for NVIDIA PersonaPlex full-duplex conversational AI.

## Installation

```bash
pip install livekit-plugins-personaplex
```

## Prerequisites

You need a running PersonaPlex server on a GPU machine. See https://github.com/NVIDIA/personaplex for setup.

Set the server URL as an environment variable:

```bash
export PERSONAPLEX_URL="ws://gpu-server:8998"
```

## Usage

```python
from livekit.agents import Agent, AgentSession, JobContext, JobProcess, WorkerOptions, cli
from livekit.plugins import personaplex, silero

async def entrypoint(ctx: JobContext):
await ctx.connect()

session = AgentSession(
vad=ctx.proc.userdata["vad"],
llm=personaplex.RealtimeModel(
voice="NATF2",
text_prompt="You are a friendly assistant named Aria.",
),
)

await session.start(
agent=Agent(instructions="You are a friendly assistant."),
room=ctx.room,
)

def prewarm(proc: JobProcess) -> None:
proc.userdata["vad"] = silero.VAD.load()

if __name__ == "__main__":
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint, prewarm_fnc=prewarm))
```

## Configuration

```python
personaplex.RealtimeModel(
base_url=None, # Server URL (defaults to PERSONAPLEX_URL env var, then ws://localhost:8998)
voice="NATF2", # Voice prompt (NATF0-3, NATM0-3, VARF0-4, VARM0-4)
text_prompt="You are helpful.", # System prompt / persona description
seed=None, # Optional seed for reproducibility
silence_threshold_ms=500, # Silence duration before finalizing a generation
)
```

## Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| `PERSONAPLEX_URL` | PersonaPlex server address | `ws://localhost:8998` |
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""PersonaPlex plugin for LiveKit Agents

Support for NVIDIA PersonaPlex full-duplex conversational AI model.
"""

from . import realtime
from .models import PersonaplexVoice
from .realtime.realtime_model import RealtimeModel, RealtimeSession
from .version import __version__

__all__ = [
"PersonaplexVoice",
"realtime",
"RealtimeModel",
"RealtimeSession",
"__version__",
]

from livekit.agents import Plugin

from .log import logger


class PersonaplexPlugin(Plugin):
def __init__(self) -> None:
super().__init__(__name__, __version__, __package__, logger)


Plugin.register_plugin(PersonaplexPlugin())

# Cleanup docs of unexported modules
_module = dir()
NOT_IN_ALL = [m for m in _module if m not in __all__]

__pdoc__: dict[str, bool] = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import logging

logger = logging.getLogger("livekit.plugins.personaplex")
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from __future__ import annotations

from typing import Literal

PersonaplexVoice = Literal[
"NATF0",
"NATF1",
"NATF2",
"NATF3",
"NATM0",
"NATM1",
"NATM2",
"NATM3",
"VARF0",
"VARF1",
"VARF2",
"VARF3",
"VARF4",
"VARM0",
"VARM1",
"VARM2",
"VARM3",
"VARM4",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from .realtime_model import RealtimeModel, RealtimeSession

__all__ = ["RealtimeModel", "RealtimeSession"]

# Cleanup docs of unexported modules
_module = dir()
NOT_IN_ALL = [m for m in _module if m not in __all__]

__pdoc__: dict[str, bool] = {}

for n in NOT_IN_ALL:
__pdoc__[n] = False
Loading