Skip to main content

Ojin avatar (Speech-To-Video) service for Pipecat

Project description

pipecat-ojin

Ojin's Pipecat integration: drop a lip-synced talking-avatar face (OjinVideoService) into your existing pipeline in minutes.

OjinVideoService is the one stage that turns a voice agent into a video-call avatar — it lip-syncs to whatever your TTS produces and streams the avatar video back. It sits in the same slot as other video services in pipecat:

transport.input() -> STT -> LLM -> TTS -> [OjinVideoService] -> transport.output()

This package is a thin adapter over the framework-agnostic ojin-client SDK — all avatar behaviour (A/V sync, audio-as-clock playback, barge-in re-sync) lives in the SDK. It is not a fork of Pipecat — it depends on pipecat-ai as a library.

The SDK also shapes the audio it forwards to Ojin — priming a lead, then coalescing your TTS into large chunks — so the inference head never starves and lip-sync stays stable, whatever cadence your TTS produces. You don't manage input buffering, the playback clock, or frame-dropping; OjinVideoService just sits after your TTS and lip-syncs to it.

Install

pip install pipecat-ojin

This pulls in pipecat-ai and ojin-client[stv]. You provide the STT / LLM / TTS services for your pipeline (e.g. pip install "pipecat-ai[deepgram,groq,elevenlabs]").

Quickstart — the avatar face

from pipecat.pipeline.pipeline import Pipeline
from pipecat_ojin import OjinVideoService, OjinVideoSettings

avatar = OjinVideoService(
    OjinVideoSettings(
        api_key="OJIN_API_KEY",
        config_id="OJIN_CONFIG_ID",   # the Face model to drive
    )
)

pipeline = Pipeline(
    [transport.input(), stt, llm, tts, avatar, transport.output()]
)

The avatar's frame size comes from your Face model (config_id) — set your transport's video_out_width / video_out_height to match it (the example uses 512×512).

Get your OJIN_API_KEY and a Face model OJIN_CONFIG_ID from ojin.ai (docs: docs.ojin.ai).

Session tracing (optional)

Pass an ojin.stv.OjinSessionTrace to record a per-call Perfetto trace; the service dumps it on close:

from ojin.stv import OjinSessionTrace

trace = OjinSessionTrace(session_id="my-call", config_id="OJIN_CONFIG_ID")
avatar = OjinVideoService(OjinVideoSettings(...), session_trace=trace)

Example

A complete, runnable voice + avatar agent (browser WebRTC or Daily) lives in examples/ojin-bot/.

Deployment

OjinVideoService connects to Ojin over a WebSocket built for server-to-server use on a stable connection. Run your pipeline on a backend — ideally in US East, near Ojin's inference — for the lowest latency, and deliver the final media to your users over a realtime transport such as WebRTC or Daily.

Troubleshooting

  • Avatar's mouth barely moves — confirm TTS audio is actually flowing into OjinVideoService. The SDK shapes the feed for you, so this usually means the pipeline isn't producing audio rather than a chunking problem.
  • Garbled or stretched video — your transport's video_out_width / video_out_height must match the Face model's frame size (image_size, e.g. 512×512).
  • Higher latency than expected — run the pipeline server-side in US East over a stable connection; don't run it on an end-user device.
  • No backend servers available — inference capacity is momentarily exhausted; retry shortly.

Full guidance lives at docs.ojin.ai → Guides → Optimizing Performance / Troubleshooting.

Compatibility

Requirement Version
Python ≥ 3.11
pipecat-ai ≥ 1.3.0
ojin-client[stv] ≥ 0.7.1

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pipecat_ojin-0.1.3.tar.gz (19.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pipecat_ojin-0.1.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file pipecat_ojin-0.1.3.tar.gz.

File metadata

  • Download URL: pipecat_ojin-0.1.3.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipecat_ojin-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e95a10cc4e22b86eb3fb04e3b9d3eb4c85e32fe1abaa78c7ab6c669522179ede
MD5 38bfa1f5fdbf439fff3b830bd4795b3d
BLAKE2b-256 3eef6ce0b3b729e2eb72a8d1d86316fa07dc3b72b6f06ffbc843e4d5f980e3ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_ojin-0.1.3.tar.gz:

Publisher: release.yml on ojinai/pipecat-ojin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pipecat_ojin-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pipecat_ojin-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pipecat_ojin-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a881cdcabfebb084dcd449b152e22c5cdfa324a79d2882e92c6765e61e69710a
MD5 b89ca02c6f2c7ab4f137aa537ef632bb
BLAKE2b-256 8509fb02242fbdd7ea4c99ba0ae417fb0ffce75b63e9ffb337790cb79e4e9b7f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pipecat_ojin-0.1.3-py3-none-any.whl:

Publisher: release.yml on ojinai/pipecat-ojin

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page