File size: 5,188 Bytes
c37e783
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6bf8d45
 
 
 
 
 
 
c37e783
 
 
 
 
 
 
 
 
 
 
bdaeacd
 
 
 
314ae95
 
 
 
6bf8d45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# FREESTREAM πŸš€

> **Free-tier avatar-meeting agent** β€” joins calls, speaks with an on-device voice,
> wears an animated avatar, and roleplays as an agent that can work a real terminal.
> CLI-compatible drop-in for [Pika's pikastream-video-meeting](https://github.com/Pika-Labs/Pika-Skills)
> ($0.20–0.28/min hosted) at **$0/min marginal cost**.

[![demo](https://img.shields.io/badge/-%20live%20demo%20-blue)](https://huggingface.co/spaces/LoveLogicAI/freestream-demo)
[![license](https://img.shields.io/badge/license-Apache--2.0-green)](LICENSE)
[![e2e](https://img.shields.io/badge/e2e--livekit-13%2F13%20%E2%9C%94-brightgreen)](docs/LATENCY.md)
[![e2e](https://img.shields.io/badge/e2e--roleplay-17%2F17%20%E2%9C%94-brightgreen)](docs/LATENCY.md)

**Try the cognition layer in-browser:** [freestream-demo Space](https://huggingface.co/spaces/LoveLogicAI/freestream-demo) β€”
talk to Captain Vera Steel (safe mode).


**A universal, free-tier avatar-meeting skill.** Clean-room reimplementation,
CLI-compatible with [`Pika-Labs/Pika-Skills` β€” pikastream-video-meeting](https://github.com/Pika-Labs/Pika-Skills)
(Apache-2.0). Same CLI surface, same exit codes, same output JSON β€” any agent
trained on the Pika skill works unchanged. The metered hosted pipeline is
replaced by swappable local drivers.

## Measured results (8 vCPU, CPU-only β€” docs/LATENCY.md)

| Metric | Result |
|---|---|
| Win condition (assistant profile) | **t_perceived 2.94s ≀ 4.0s β€” PASS** |
| Agentic roleplay e2e | **17/17 β€” ROLEPLAY E2E OK** |
| ASR finalize (whisper tiny.en int8, 1 thread) | 1.33s |
| First-audio TTS path (cached disclosure) | ~0.2s |
| Full turn (14.9s of speech) | 18.9s, pipelined |
| Session replay | both hash chains verify |

This is **v0.1.0 β€” MVP slice working and measured**: the LiveKit presence driver,
faster-whisper ASR (utterance VAD β†’ transcribe), Piper TTS with sentence-level
streaming, and the audio-reactive procedural avatar all run end to end. The
win condition β€” *agent joins, answers within 4s with a moving mouth, leaves,
and produces a valid replay log* β€” **passes: t_perceived = 2.94s on 8 vCPU,
CPU-only, both turns answered via speculative dispatch** (measured 2026-10-04,
job 6ac2e756404719ba37651973, see docs/LATENCY.md). Remaining stubs: the
browser join-pack (Meet/Zoom), the SIP driver, and local portrait-model rungs.

## The three-layer split

| Layer | Job | Drivers (preference order) |
|---|---|---|
| Presence | Get a participant into the call, own an A/V track | `livekit` (free, low jitter) β†’ `browser` (Playwright + virtual cam) β†’ `sip` (audio-only) |
| Persona | A face and a voice | Fidelity ladder: FULL_PORTRAIT β†’ VISEME_STILL β†’ AUDIO_REACTIVE_WAVE β†’ STATIC_CARD; Piper TTS, local-only clones |
| Cognition | The agent, unchanged | MCP: `session.observe` / `speak` / `listen` / `leave` |

## Quick start

```bash
pip install -r requirements.txt

# What can this host deliver?
python scripts/freestream.py probe

# Join (MVP slice targets Jitsi / LiveKit first)
python scripts/freestream.py join --meet-url <url> --bot-name <name> \
  --image identity/videomeeting-avatar.png

# Drive the session as an agent
python -m freestream.mcp_server
```

## CLI surface (Pika-compatible)

```
freestream join  --meet-url <url> --bot-name <name> --image <path>
                 [--voice-id <id>] [--system-prompt-file <path>]
                 [--system-prompt <text>] [--meeting-password <pw>]
                 [--platform jitsi|livekit|google_meet|zoom] [--timeout-sec 90]
freestream leave --session-id <id>
freestream generate-avatar --output <path> [--prompt <text>]
freestream clone-voice --audio <file> --name <name> [--noise-reduction]
freestream probe                              # FREESTREAM addition: capability negotiation
```

**Exit codes** β€” preserved from Pika, one repurposed:

- `0` ok Β· `1` configuration (FREESTREAM addition) Β· `2` validation Β·
  `3` transport Β· `4` session Β· `5` timeout
- `6` **capability shortfall** (was Pika's *funding*). Stdout JSON carries
  `capability` + `remediation` instead of `checkout_url`.

`join` emits `{"session_id", "platform", "status": "created"}` immediately,
then status-change lines, exactly like the Pika CLI β€” agents that parse that
stream keep working.

## Latency trade-off

~2.5–4.5s perceived turn on CPU vs. Pika's ~1.5s hosted (~1.2–2.0s with
GPU). Mitigated by 600ms speculative dispatch, sentence-level pre-roll, and
avatar motion starting ~150ms before audio. See `docs/LATENCY.md`.

## Privacy

Face and voice clones never leave the device. Hosted clones (Pika/MiniMax)
expire after 7 days of non-use; FREESTREAM clones are local files. Consent
and disclosure defaults: `docs/CONSENT.md`.

## Attribution & license

Apache-2.0. Clean-room reimplementation of the CLI contract of
[pikastream-video-meeting](https://github.com/Pika-Labs/Pika-Skills/tree/main/pikastream-video-meeting)
by Pika Labs β€” no source code ported; the interface (CLI flags, exit codes,
output JSON, SKILL.md agent flow, `life/` identity-file conventions) is
preserved for agent compatibility. The hosted PikaStreaming service is
replaced, not reimplemented.