Skip to content

docs: design spec for multimodal stream governance - #107

Open
tishachawla-jg wants to merge 2 commits into
mainfrom
spec-multimodal-stream-governance
Open

tishachawla-jg wants to merge 2 commits into
mainfrom
spec-multimodal-stream-governance

Conversation

@tishachawla-jg

Copy link
Copy Markdown
Collaborator

Summary

Adds a draft design spec (docs/notes/multimodal-stream-governance-spec.md) for governing continuous media streams (audio, video, realtime voice) on cost, provider-agnostic. Safety/content moderation explicitly out of scope.

Approach

Reuses primitives that already exist rather than building a new engine:

Core idea: time-windowed accrual. Cost accrues locally as frames arrive and flushes to the ledger on a fixed window (default 500ms); budget checks run at flush time, not per frame. Overhead is bounded regardless of frame rate.

Pricing, grounded in real 2026 APIs

Research into how streaming APIs actually bill shaped the abstraction:

  • OpenAI Realtime: audio per token (in/out split, cached-audio rate)
  • Gemini Live: audio at fixed tokens/sec, video per second

The unifying unit is seconds of stream, mapped per provider to a billable quantity. One price(modality, direction, quantity, cached) signature covers both token-metered and time-metered providers; a provider stream adapter does the mapping.

Status

Draft / design. No implementation yet; the doc includes a phasing plan. Opening as a PR so the design is reviewable and citable.

🤖 Generated with Claude Code

Draft design for governing continuous media streams (audio, video,
realtime voice) on cost, provider-agnostic. Builds on primitives that
already exist: the tick() time-based moment, stream_complete, and the
declared-but-unimplemented CANCEL actuator (#67). Core idea is
time-windowed accrual driven by tick, not per-frame pricing, so
overhead is bounded regardless of frame rate.

Pricing section grounded in how real 2026 streaming APIs bill
(OpenAI Realtime per-token audio with cached-audio rates; Gemini Live
fixed tokens-per-second audio and per-second video): the universal
unit is seconds of stream, mapped per provider to a billable
quantity, so one price(modality, direction, quantity, cached)
signature covers both token-metered and time-metered providers.

Status: draft. No implementation yet; phasing in the doc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add a section grounding the abstraction in the three real voice
pipelines (speech-to-speech, speech-to-text, text-to-speech): how each
flows, the unit it bills in, its distinct denial-of-wallet shape, and
an approximate 2026 anchor price. Shows that three billing units
(tokens, minutes, characters) and two directions collapse into one
price() call and one accrual loop, and motivates why the detectors
cover duration, spend, and rate rather than a single one.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant