Commit Graph

6 Commits

Author SHA1 Message Date
Praxis CI bba99418df feat(P01-02-04): Pipecat server pipeline — Silero VAD→Deepgram→Ollama→TTS→WebRTC
server/pipeline.py assembles the Pipecat pipeline (D-017): WebRTC audio in →
Deepgram Nova-3 STT → LLMContextAggregator(user) → OLLamaLLMService
(gemma4:cloud via https://ollama.com/v1 + bearer, R6) → Cartesia/Piper TTS
(selected via PRAXIS_TTS) → WebRTC audio out. Interruptibility via
allow_interruptions=True (D-008 abort-and-yield). Hardcoded single-turn
system prompt (SLICE-03 replaces with scenario YAML). All keys from env;
missing keys log a warning and the pipeline still starts (code structure is
the deliverable). server/__main__.py exposes a FastAPI app with /health
(reports key-provisioning status) and POST /pipecat/webrtc (accepts an SDP
offer, starts a pipeline task, returns the answer). Verified: imports
succeed, /health returns 200, routes wired.

---ci---
phase: 1
milestone: v0.1
plan: 02
task: 02-04
status: execute
persona: backend-engineer
requirements:
  covered: [REQ-VOICE-01, REQ-VOICE-02, REQ-VOICE-04, REQ-ORCH-01]
---/ci---
2026-08-01 13:04:17 +00:00
Praxis CI 733ba34f6d feat(P01-02-07): NoOpGuardrail stub — pluggable guardrail hook in place
server/guardrails/noop.py implements the Guardrail interface with an
always-allow stub so the Pipecat pipeline has the pluggable hook from
SLICE-02. Swapping to CustomerServiceGuardrail (SLICE-03 TASK-03-04)
requires no pipeline change (D-019). The session-start disclaimer text
(RESEARCH.md safety baseline) is defined here so the pipeline can play
it as the first AI utterance even before the real ruleset lands.

---ci---
phase: 1
milestone: v0.1
plan: 02
task: 02-07
status: execute
persona: backend-engineer
requirements:
  covered: [REQ-ORCH-02]
---/ci---
2026-08-01 13:01:58 +00:00
Praxis CI 2a9111c58c feat(P01-02-03): OllamaCloudLLM adapter behind LLMProvider (R6)
server/llm/ollama_cloud.py wraps the Ollama Cloud direct API
(https://ollama.com/api/chat + bearer, stream=True) behind LLMProvider.
chat() streams LLMStreamChunk (is_first flag for TTFT measurement);
chat_full() accumulates for the debrief / branch classifier (offline).
Two models: gemma4:cloud (roleplay_model) + deepseek-v4-flash:cloud
(debrief_model, no_think mode for latency, D-020). Resolves R6 — the
adapter confirms the direct API + bearer path; a live first-token
confirmation is pending the R3 probe with a real key. Graceful no-key
degradation (no chunks, no crash). 6 unit tests pass (mocked httpx
streaming response + env model selection + chat_full accumulation).

---ci---
phase: 1
milestone: v0.1
plan: 02
task: 02-03
status: execute
persona: backend-engineer
requirements:
  covered: [REQ-LLM-01, REQ-LLM-02]
---/ci---
2026-08-01 13:01:37 +00:00
Praxis CI f0afc8ef57 feat(P01-02-02): Cartesia + Piper TTS adapters behind TTSProvider
server/tts/cartesia_tts.py wraps the raw Cartesia Sonic WebSocket API
(wss://api.cartesia.ai/tts/websocket) — streaming PCM s16le, one voice
(CARTESIA_VOICE_ID, D-006). server/tts/piper_tts.py wraps piper-tts
self-hosted synthesis (R4 mitigation, open-weights). Both implement
TTSProvider (synthesize streaming + synthesize_all). Both degrade
gracefully (no audio, no crash) when the API key / voice model is absent.
PRAXIS_TTS=cartesia|piper selects the adapter via the registry with no
pipeline change (D-014). 7 unit tests pass (mock streams + env selection
+ graceful missing-key/model handling).

---ci---
phase: 1
milestone: v0.1
plan: 02
task: 02-02
status: execute
persona: backend-engineer
requirements:
  covered: [REQ-VOICE-02]
---/ci---
2026-08-01 13:00:54 +00:00
Praxis CI 47e24dbe59 feat(P01-02-01): service interfaces — TTSProvider, LLMProvider, Guardrail
server/services/base.py defines three abstract base classes with type
annotations: TTSProvider (async synthesize/synthesize_all, voice_id), LLMProvider
(async chat/chat_full, roleplay_model, debrief_model), Guardrail (async check,
session_start_disclaimer). GuardrailVerdict/Context/TTSResult/LLMStreamChunk
dataclasses carry typed metadata. server/services/registry.py resolves the
active adapter from env (PRAXIS_TTS, PRAXIS_GUARDRAIL) so the pipeline never
imports a concrete adapter directly — D-014/D-019/D-020 swap wiring. Verified:
'from server.services import TTSProvider, LLMProvider, Guardrail' succeeds.

---ci---
phase: 1
milestone: v0.1
plan: 02
task: 02-01
status: execute
persona: backend-engineer
requirements:
  covered: [REQ-VOICE-02, REQ-LLM-01, REQ-ORCH-02]
---/ci---
2026-08-01 13:00:00 +00:00
Praxis CI ea1b77535e feat(P01-01-01): create repo skeleton for v0.1 minimal voice loop
server/, client/, scenarios/, db/, scripts/, tests/, docs/ dirs match
PERSONAS.md territory. pyproject.toml declares pipecat-ai[deepgram,cartesia,piper,webrtc]
+ openai + pydantic + pyyaml + aiosqlite + httpx + websockets. .env.example
documents DEEPGRAM_API_KEY, CARTESIA_API_KEY, OLLAMA_API_KEY and the TTS
selection (PRAXIS_TTS=cartesia|piper). Verified: python -c 'import pipecat'
succeeds (pipecat-ai 1.6.0 installed).

---ci---
phase: 1
milestone: v0.1
plan: 01
task: 01-01
status: execute
persona: lead-developer
requirements:
  covered: [REQ-ORCH-01]
---/ci---
2026-08-01 12:54:56 +00:00