Skip to main content

Anchorcast

A Python client for real-time media streams generated by pluggable models.

CI PyPI License: MIT Python 3.11+

Early (0.1.1). The session / model / source interface is the point. Expect it to move.

Install

pip install anchorcast

From git:

pip install git+https://github.com/scrollmark/anchorcast.git

For local development:

git clone https://github.com/scrollmark/anchorcast.git
cd anchorcast
python3.11 -m pip install -e ".[dev]"
python3.11 -m pytest

Requirements: Python 3.11+, ffmpeg on PATH (for last-frame continuity), and a fal key if you use the H3 Max adapter (FAL_KEY or FALAI_API_KEY).

Quickstart

Prompt-only (text-to-video, no character):

from pathlib import Path

from anchorcast import Brief, QueueSource, Session
from anchorcast.models import H3Max

source = QueueSource()
session = Session(
    model=H3Max(),
    source=source,
    workdir=Path(".anchorcast"),
    buffer_clips=1,
)
source.submit(
    Brief(
        id="kitten",
        topic="garden",
        prompt="A white kitten chases a butterfly across a sunlit garden.",
    )
)
for event in session.run(max_segments=1):
    print(event.segment.path, event.segment.brief.topic)

A talking-head still is optional. Pass character= and render_prompt= (see examples/literary_bear) when you want image-to-video continuity.

A Brief is the next slot. The session asks the source for one, asks the model for a clip, and keeps a small generate-ahead buffer so you do not mint faster than the playhead.

Core types

Type Role
Brief Next slot: prompt and/or talking points, topic, citations, priority
Character Optional seed still, visual prompt, voice description
Model generate(request) -> Segment. H3Max uses I2V when there is a still, T2V when there is not
Source next_brief(playhead) -> Brief | None
Continuity Optional start still (LastFrameContinuity or IdentityContinuity)
Session Buffer, pacing, event stream

Sources

  • QueueSource — explicit briefs, ordered by priority
  • FeedSource — RSS/Atom mapped to cited stories
  • IdleSource — character bits that make no news claims

When the queue is empty, pass idle=IdleSource(character) so the session can keep breathing without inventing facts.

Custom model

from anchorcast.types import GenerateRequest, Segment

class MyModel:
    def generate(self, request: GenerateRequest) -> Segment:
        # write a video to request.output_path
        return Segment(
            path=request.output_path,
            duration=15.0,
            generated_in=1.0,
            brief=request.brief,
        )

Custom source

from anchorcast.types import Brief, Playhead

class WebhookSource:
    def next_brief(self, playhead: Playhead | None = None) -> Brief | None:
        return self._take_from_queue()

YouTube Live, Twitch, TikTok Live, and Super Chats are a later backend. That layer should map platform events into Briefs and submit them to a QueueSource. It does not belong in this client.

Status

  • Generate-ahead Session with a pluggable model and source
  • fal MiniMax H3 Max adapter (image-to-video when a still is present, text-to-video otherwise)
  • Feed, queue, and idle sources
  • Last-frame continuity via ffmpeg

Not yet: RTMP output, hosted APIs, or platform chat integrations.

Example app

examples/literary_bear is a continuous 1926 literary-bear news stream (Shepard, not Disney). Each clip is the next fifteen seconds of one monologue, not a fresh "oh bother" cold open.

python3.11 -m examples.literary_bear --dry-run   # scripts only
python3.11 -m examples.literary_bear            # local player at http://127.0.0.1:8765

--llm or OPENAI_API_KEY writes spoken lines with gpt-5.6-luna. --no-llm forces the rotating templates.

Development

python3.11 -m pip install -e ".[dev]"
python3.11 -m pytest

License

MIT. See LICENSE.

The example still under examples/characters/literary-bear/ is an E. H. Shepard illustration from Winnie-the-Pooh (1926), U.S. public domain. It is not Disney, and this project is not affiliated with Disney.

Release files for anchorcast 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anchorcast 0.1.1
File Size Uploaded
anchorcast-0.1.1.tar.gz 2.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for anchorcast 0.1.1
File Interpreter ABI Platform
anchorcast-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 2.0 MB

Release files / anchorcast-0.1.1.tar.gz

Download URL anchorcast-0.1.1.tar.gz
Size 2.0 MB
Tags Source
SHA-256 checksum
How to use checksums
c415946902283cef3ffad9e0600e9acde5430e8c224d19d204ec4e450c11fa78
BLAKE2b-256 checksum
How to use checksums
cc74e00398a933bab694892abe6ee29fb1f3ebf4b7c7ce41a844b97879c6ab3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release files / anchorcast-0.1.1-py3-none-any.whl

Download URL anchorcast-0.1.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
69902ffe1afc2261ad1d71084fd4e13c5653b73bd46d71a9aac4512343a23cd7
BLAKE2b-256 checksum
How to use checksums
a3d71e6f5ad4916dfddc71320444016430f50619a74605d67be97480eb402568
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 3, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page