Skip to main content

CARD Framework

CARD — Constraint-aware Audio Resynthesis and Distillation turns long, multi-speaker recordings into shorter conversational audio. It summarizes toward a chosen duration and resynthesizes the dialogue using the original speakers' voices.

The project combines speech transcription with a summarizer–critic loop and voice cloning. Optional backchannels and overlapping speech add conversational detail to the final audio.

How it works

flowchart LR
    A["Source audio"] --> B["Transcribe & identify speakers"]
    B --> C["Summarize to target duration"]
    C --> D["Resynthesize speaker voices"]
    D --> E["Add optional interjections"]
    E --> F["Shortened audio"]
Stage What it does
Audio preparation Separates speech, transcribes the recording, and identifies speakers
Summarization Revises speaker-tagged dialogue against content and duration checks
Voice synthesis Renders summary turns with IndexTTS; can render during summary editing
Interjection Adds optional backchannels and speech overlap

Runs produce a transcript, a speaker-tagged XML summary, and audio outputs when synthesis is enabled. The repository also includes QMSum and SPoRC summarization benchmarks, source-grounded question answering, and speaker diarization evaluation.

Install with pip

Requires Python 3.12 or newer.

pip install card-framework
card-framework doctor

card-framework doctor checks FFmpeg, uv, the GPU, the LLM, and disk space, and says how to fix anything that's missing. It doesn't download anything.

CARD uses an LLM to write the summary. By default that's a vLLM server at http://localhost:8000/v1; point to another one with --llm-url. To use a hosted model instead, set its API key and pick a profile:

export DEEPSEEK_API_KEY=...    # PowerShell: $env:DEEPSEEK_API_KEY = "..."
card-framework shorten episode.wav --to 5m --llm deepseek_chat

Keys can also go in a .env file in the folder you run from. Other profiles include google_gemini, glm_46, and anthropic_claude_opus. An unknown name lists them all.

While a run is going, CARD lists each stage as it finishes and writes the pipeline's full output to card.log in the output folder. Partway through shortening an hour-long episode, it looks like this:

 ▂▅█▆▃  CARD  episode.wav → 5:00

   ✓   Setup                                                               0:41
   ✓   transcript.json               2 speakers, 58:12 of speech           6:02
   ⠋   summary.xml                   Writing a summary that fits the time  0:09
   ·   voice_cloned.wav
   ·   voice_cloned_interjected.wav

   Log: episode-5m/card.log

When the run ends, CARD prints the path of the shortened audio on stdout, so card-framework shorten ... | xargs ffplay works. --json prints every output path instead. card-framework shorten --help lists the other options. The command exits with 0 on success, 1 if the run fails, 2 for bad arguments, 3 when something is missing (see doctor), and 130 if you stop it.

The first run downloads several GB of models. Packaged CPU inference supports Windows and Linux on x86_64 and macOS on Apple Silicon; CUDA inference needs Windows or Linux on x86_64 with CUDA 12.6. A pip install includes speaker diarization only on Linux, so on Windows and macOS CARD treats each recording as one speaker.

From Python

from card_framework import infer

result = infer("episode.wav", "outputs/episode", 300, llm="deepseek_chat")
print(result.final_audio_path)

infer() draws the same stage list. device defaults to "auto", which uses a CUDA GPU when PyTorch can see one. Pass vllm_url= to use your own server, or verbose=True to stream the pipeline's full output. If a prerequisite is missing, infer() raises NotReadyError before downloading anything.

Run from a source checkout

Use Docker Compose for the full source-checkout workflow:

git clone https://github.com/Lolfaceftw/card-framework.git
cd card-framework
cp .env.example .env

On PowerShell, use Copy-Item .env.example .env for the copy step.

Set your model provider in conf/config.yaml and add any required credentials to .env. The default LLM profile expects a running, OpenAI-compatible vLLM endpoint. Set CARD_FRAMEWORK_VLLM_BASE_URL in .env to an address reachable from the container. Container localhost refers to the container itself.

Place an input recording at audio.wav, then build and run:

docker compose build setup-and-run
docker compose run --rm setup-and-run --audio-path audio.wav

For an NVIDIA GPU exposed to Docker:

docker compose --profile gpu run --rm setup-and-run-gpu --override audio.device=cuda --audio-path audio.wav

Use --help for available run options. See Configuration for duration settings, provider selection, and Docker runtime requirements. The first run downloads model weights and prepares the speech runtime.

For source development, install dependencies with uv sync --dev. Run checks with uv run ruff check . and uv run pytest.

Project files

Path Contents
src/card_framework/ Audio processing, summarization, and runtime code
conf/config.yaml Source-checkout settings
tests/ Automated checks
scripts/ SPoRC benchmark preparation and analysis helpers
Dockerfile, compose.yml Container build and run setup

Research and license

Developed as an undergraduate research project at the University of the Philippines Diliman by the CARD Framework authors.

Distributed under the PolyForm Noncommercial 1.0.0 license. See the license for permitted uses and required notices.

Metadata

Release files for card-framework 1.5.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 card-framework 1.5.1
File Size Uploaded Provenance Actions
card_framework-1.5.1.tar.gz 1.3 MB Without provenance Details for card_framework-1.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for card-framework 1.5.1
File Interpreter ABI Platform Actions
card_framework-1.5.1-py3-none-any.whl Python 3 none any Details for card_framework-1.5.1-py3-none-any.whl

Total release size: 2.9 MB

Release files / card_framework-1.5.1.tar.gz

Download URL card_framework-1.5.1.tar.gz
Size 1.3 MB
Tags Source
SHA-256 checksum
How to use checksums
d3fdca911b3acd9c8e36bd32bbf5f081faddaa0648675cc867744dc8227f3a55
BLAKE2b-256 checksum
How to use checksums
cfe4ba8e6ea87814859ee9560760864618d7fa91bebbe2d76cf14837ab46eb54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / card_framework-1.5.1-py3-none-any.whl

Download URL card_framework-1.5.1-py3-none-any.whl
Size 1.5 MB
Tags Python 3
SHA-256 checksum
How to use checksums
1502f83ae35e39191e2c5d25c6fbee0ac2944573697bde508c422ed30d1d7946
BLAKE2b-256 checksum
How to use checksums
3025246b90c4afec9fc19a2e0751f48b1d6079941ba96a52c1a2ab01d2ba6074
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for card-framework 1.5.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.5.1 This release

2 release files No provenance

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