jargo README

README проекта с github.com/gojargo/jargo. Одним файлом markdown: README.md.

jargo

Real-time voice AI agents in Go.

CI Coverage Go Reference OpenSSF Scorecard Go version Release License: BSD-2-Clause


jargo is a framework for real-time voice agents in Go: audio in over WebRTC, a streaming transcription → reasoning → speech pipeline with turn-taking and barge-in, and audio back out.

A jargo voice agent being interrupted mid-sentence: VAD cancels the speech and Smart Turn detects the end of the user's turn. Click to watch the demo.
Watch the demo: turn-taking and barge-in, live.

Try it in one minute

No API keys and no native libraries: the echo bot sends your microphone back to you over WebRTC.

git clone https://github.com/gojargo/jargo && cd jargo
go run ./examples/echo        # then open http://localhost:8080

For a real voice agent, follow the Quickstart.

Why?

Pipecat is great, and jargo is a port of it. The architecture and many design decisions are Pipecat's.

Python might not be the way

This port exists for one reason: I'd rather not run a voice agent on Python.

Python is the right tool when you need the AI/data-science ecosystem. A real-time voice server doesn't: the models run as services or as ONNX, and what's left is plumbing: audio framing, WebRTC, concurrency, and shipping a binary. For that, Go is a better fit: one static binary to deploy, low and predictable memory, fast startup, and real concurrency for many simultaneous sessions without a GIL. The heavy numerics stay where they belong (the ONNX Runtime, the remote services), so giving up Python costs little here. See the benchmarks for the honest performance picture.

Benchmarks

1,000 concurrent sessions served on 3 CPUs: one jargo process, against one Pipecat 1.15 process per CPU (the GIL holds each to one core).

jargo Pipecat
Memory, idle 8.6 MiB 162 MiB
Memory, 1,000 sessions 124 MiB 357 MiB
Throughput 96k frames/s 10.8k frames/s
Startup per session 0.12 ms 1.08 ms

Medians of 6 runs on a GitHub-hosted runner (AMD EPYC 7763), every difference significant. This is framework overhead only: provider round trips dominate what a caller hears, and cost the same on both. Method.

Features

Providers

Pick any per category; each is a small Config + constructor.

Usage

go get github.com/gojargo/jargo

A bot is an STT → LLM → TTS pipeline over a WebRTC transport. The heart of it:

import (
	"github.com/gojargo/jargo/audio/opus"
	"github.com/gojargo/jargo/frames"
	"github.com/gojargo/jargo/pipeline"
	"github.com/gojargo/jargo/processor/aggregators"
	"github.com/gojargo/jargo/provider/openai/chat"
	"github.com/gojargo/jargo/transport"
	"github.com/gojargo/jargo/transport/rtc"
)

stt := chat.NewSTT(chat.STTConfig{APIKey: key, SampleRate: opus.SampleRate})
llm := chat.NewLLM(chat.LLMConfig{APIKey: key})
tts := chat.NewTTS(chat.TTSConfig{APIKey: key})

t := rtc.NewTransport(conn, transport.DefaultParams())
agg := aggregators.New(frames.NewLLMContext("You are a helpful voice assistant."))

worker := pipeline.NewWorker(pipeline.New(
	t.Input(), stt, agg.User(), llm, tts, t.Output(), agg.Assistant(),
), pipeline.WorkerConfig{})
worker.Run(ctx)

examples/getting-started/06-voice-agent is a complete voice agent on the dev runner (WebRTC signaling, a browser client, VAD and turn-taking, barge-in).

Examples

Runnable bots live in examples/. Start with the getting-started series, which builds up from one spoken sentence to a voice agent with tools, each step a short bot function on the development runner:

CARTESIA_API_KEY=... go run ./examples/getting-started/01-say-one-thing
# then open http://localhost:7860

The others:

Coming from Pipecat?

jargo keeps Pipecat's model: frames, processors, pipelines, service bases, context aggregators and RTVI, mostly under the same names (a PipelineTask is a pipeline.Worker, a PipelineRunner a workers.Runner). A Pipecat bot maps onto jargo almost line for line, so its design knowledge carries over.

Clients carry over too. The development runner serves Pipecat's prebuilt browser UI over the same /api/offer WebRTC signaling, and the RTVI processor speaks protocol 2.4.0 (and answers 1.x clients in their own version), so existing RTVI clients connect without changes.

Documentation

gojargo.dev is the full documentation. The same pages live in docs/ and read fine on GitHub.

Start with Architecture for the model, or Frames and Processors for the engine. Writing a processor covers extending it. The API reference is the Go reference.

What you need to install

Nothing, to build: the default build is cgo-free, so CGO_ENABLED=0 go build ./... works with no C toolchain and no system packages.

To run a voice bot you need one shared library, and only for turn-taking:

What When you need it How to get it
ONNX Runtime VAD and end-of-turn detection. Without it the bot still runs, on STT endpointing, and loses barge-in. make deps-onnx, or a release
RNNoise Optional input noise reduction. make deps-rnnoise

Both libraries are loaded at run time through purego, so they are never needed at build time. Point jargo at them with JARGO_ONNXRUNTIME_LIB and JARGO_RNNOISE_LIB, or leave them on the loader's default search path. The base images bundle all of them.

Deploy

Build on the gojargo/jargo-build base image and ship on the distroless gojargo/jargo runtime (it bundles the ONNX Runtime), then:

docker run --rm -p 8080:8080 -e OPENAI_API_KEY=$OPENAI_API_KEY my-bot

See Deploy with Docker for the Dockerfile and the Quickstart for the full setup.

Status

jargo follows Semantic Versioning. Within a major version the public API only grows: a change that would break code written against it waits for the next major release, and what it replaces is deprecated first. A package whose doc comment marks it Experimental may still change in a minor release, and the changelog says so when it does. Only the latest release receives security fixes (see SECURITY.md).

Contributing

Contributions are welcome: bug reports, fixes, new providers, examples and docs. Read CONTRIBUTING.md to get started, and look for issues labelled good first issue. Questions and show-and-tell go in Discussions.

License & attribution

jargo is a Go port of Pipecat, distributed under the same BSD 2-Clause License. The upstream copyright (Copyright (c) 2024–2026, Daily) is preserved verbatim in LICENSE; see NOTICE for details. jargo is an independent project, not affiliated with or endorsed by Daily.

jargo (gojargo/jargo)

Ищем в базе…

Что это такое?Jargo — это WebRTC-ориентированный аудио-фреймворк для создания разговорного ИИ на Go. С его помощью строят голосовых агентов реального времени по конвейеру потоковый STT → LLM → TTS, с определением очередности реплик и перебиванием (barge-in).
Это фреймворк, который я импортирую, или отдельный сервер, который я запускаю?Это Go-фреймворк/библиотека из подключаемых процессоров (транспорты, сервисы STT, LLM, TTS), которые вы соединяете в бота; каталог examples показывает готовые к запуску серверы, построенные поверх него.
Как запустить голосового бота?Воспользуйтесь документацией Quickstart, запустите один из примеров вроде 'go run ./examples/voice/openai' и подключитесь из браузерного клиента, либо соберите Docker-образы (базовый gojargo/jargo-build, runtime — gojargo/jargo-build) и разверните их.
Нужен ли мне C-компилятор или какие-то системные пакеты для сборки?Нет, сборка по умолчанию идёт без cgo, так что 'CGOENABLED=0 go build ./...' работает без C-компилятора; но чтобы реально работало определение очередности реплик, нужна разделяемая библиотека ONNX Runtime (ставится через 'make deps-onnx') и, по желанию, RNNoise для шумоподавления — обе подгружаются во время работы через purego.
Что будет, если я пропущу настройку ONNX Runtime?Бот продолжит работать, но вернётся к завершению фраз по паузам в STT и потеряет перебивание (barge-in), потому что именно ONNX Runtime обеспечивает VAD и определение конца реплики (Smart Turn v3).
Какие транспорты и провайдеры он реально поддерживает?Среди транспортов WebRTC (Pion), WebSockets, LiveKit, локальное аудио и Twilio Media Streams для телефонии; почти любого провайдера STT, LLM или TTS (Deepgram, OpenAI, Anthropic, Gemini, ElevenLabs, Cartesia и многие другие) можно подключить за небольшим интерфейсом.
Зачем это написано на Go, а не просто на Pipecat в Python?Автор хотел не держать сервер реального времени для голоса на Python: голосовой агент — это в основном «обвязка» (кадрирование аудио, WebRTC, конкурентность), а Go даёт один статический бинарник, низкое потребление памяти, быстрый старт и настоящую конкурентность без GIL, при этом тяжёлые ML-модели всё равно работают как внешние сервисы или через ONNX.
Можно ли попробовать без API-ключей?Да, пример 'echo' позволяет услышать себя через весь конвейер без каких-либо API-ключей — удобно проверить транспорт и аудиотракт до подключения настоящих провайдеров STT/LLM/TTS.
Поддерживаются ли модели speech-to-speech вместо цепочки STT/LLM/TTS?Да, поддерживаются голосовые агенты на одной модели, такие как OpenAI Realtime, Gemini Live и AWS Nova Sonic, как альтернатива отдельному конвейеру STT → LLM → TTS.
А настоящие телефонные звонки он выдержит?Да, есть опциональная поддержка телефонии для входящих и исходящих звонков через Twilio Media Streams, включая watchdog на случай молчания пользователя, который может снова вовлечь его в разговор или положить трубку.
Какие есть похожие проекты?Lampline, agentscope, openspline, pyvideotrans, ten-framework, pipecat, agents, Tel-Agent
Автор
gojargo
Размер
52.9 MB
Звёзды
112
Возраст
5 мес
Коммиты · 90 дней