realtimevideogen
AGENTS.md10 starsChanged 7 months agoMITView on GitHub
Modular, adaptive serving stack for real-time multi-modal generation (video, audio, images). It dynamically balances latency, cost, and quality, and supports streaming (real-time playback). It runs on a Kubernetes cluster with GPU nodes. Run these before opening a pull request: Tests use pytest with coverage. Run the relevant suite(s) afte
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,542 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repositoryOne other file it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 2 are common, 4 are distinctive, and 7 are very specific to this project.
≈2
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 27
Namespace: all K8s resources go in namespace rtgen (set via $K8S_NAMESPACE).
- Distinctive: line 31
GPU spot node pools: start at 0 nodes to save cost.
- Very specific: line 32
ACR attachment: prefer az aks update --attach-acr over imagePullSecrets when using AKS.
- Very specific: line 43
Async: use async/await and aiofiles for all I/O-bound work.
- Very specific: line 44
Logging: use the colorlog-based logger from console_utils.py.
- Common: line 46
No secrets in source: never hard-code tokens, passwords, or subscription IDs.
- Distinctive: line 50
Run these before opening a pull request:
- Very specific: line 96
Add new tests in the matching tests/ sub-directory.
- Distinctive: line 100
Must: add or update tests for every functional change.
- Very specific: line 101
Must: keep services.json valid JSON.
- Very specific: line 102
Must: run flake8 and mypy before committing.
- Common: line 103
Never: commit Azure credentials, HuggingFace tokens, or other secrets.
- Distinctive: line 106
Never: remove or weaken existing tests.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Project: Real-Time Multi-Modal Generation
Modular, adaptive serving stack for real-time multi-modal generation (video, audio, images). It dynamically balances latency, cost, and quality, and supports streaming (real-time playback). It runs on a Kubernetes cluster with GPU nodes.
Repository layout
| Path | Purpose |
services.json | Registry of every model: Docker image tags, input/output types, quality metrics. |
apps/ | Application workflows (StreamCast, StreamChat, etc.) that orchestrate model microservices. |
wrapper/ | Wrappers that exposes an HTTP endpoint for multi-modal models. |
deployment/ | All deployment artefacts (Docker, Kubernetes, Helm, Bicep, AKS, ACR, VM). |
deployment/set_properties.sh | Central config with Azure subscription, resource group, region, ACR, HF token, K8s namespace. Source this before any deployment command. |
deployment/aks/ | AKS-specific deployment (Bicep template, pod YAMLs, service accounts, NVIDIA plugin, PV/PVC). |
deployment/helm/ | Helm chart for deploying GPU model microservices. |
deployment/acr/ | ACR creation and image mirroring docs. |
deployment/bicep/ | Shared Bicep modules (ACR role assignment, VM-based K8s, etc.). |
deployment/wrappers/ | Per-model Docker build contexts (Dockerfile + setup_image.sh for each model). |
streamwise/ | StreamWise cluster manager source code. |
simulator/ | Provisioning and scheduling simulator. |
tests/ | pytest test suites: root-level utils, tests/simulator/, tests/streamwise/, tests/streamwise_app/. |
Key conventions
- Namespace: all K8s resources go in namespace
rtgen(set via$K8S_NAMESPACE). - Docker images: tagged as
<ACR_URL>/<model>:<tag>, tags come fromservices.json. - Pod YAMLs in
deployment/aks/use shell variable placeholders (${ACR_URL},${LOAD_BALANCER_IP},${RESOURCE_GROUP_NAME}). Deploy withenvsubst < file.yaml | kubectl apply -f -. - Helm chart in
deployment/helm/reads image tags fromservices.jsonvia thedeploy.shscript. - GPU spot node pools start at 0 nodes to save cost; scale up explicitly before deploying GPU workloads.
- ACR attachment: prefer
az aks update --attach-acroverimagePullSecretswhen using AKS.
Development Guide
Python coding standards
- Python version: 3.12.
- Type annotations: required on every function signature (
disallow_untyped_defs = Trueinmypy.ini). Never use bareAnywithout justification. - Line length: maximum 120 characters (enforced by flake8).
- Async: use
async/awaitandaiofilesfor all I/O-bound work. The web framework is Quart (async Flask). - Logging: use the
colorlog-based logger fromconsole_utils.py; passextra={"markup": True}where color markup is needed. Do not use f-strings in logging calls (W1203 is suppressed but plain%-style or structured logging is preferred). - Imports: stdlib → third-party → local. Module-level imports not at the top of the file are allowed (E402 suppressed in
.flake8). - No secrets in source: never hard-code tokens, passwords, or subscription IDs. Use environment variables or Azure Key Vault references.
Linting commands
Run these before opening a pull request:
# Python style
flake8 . tests
# Shell scripts
shellcheck $(git ls-files '*.sh')
shellcheck $(git ls-files '*.bash')
# Static type checking (install stubs on first run)
mypy --install-types --non-interactive --ignore-missing-imports .
# YAML
yamllint -c .yamllint.yml $(git ls-files '*.yml' '*.yaml')
# JSON
for f in $(git ls-files '*.json'); do python -m json.tool "$f" > /dev/null && echo "OK: $f"; done
# Jinja/HTML templates (|| true: j2lint exits non-zero on warnings; failures are informational)
j2lint streamwise/templates/ --extensions html || true
j2lint apps/*/templates/ --extensions html || trueTesting
Tests use pytest with coverage. Run the relevant suite(s) after making changes:
# All root-level utility and wrapper tests (fastest, no GPU required)
pytest --ignore=tests/simulator --ignore=tests/streamwise --ignore=tests/streamwise_app -vv
# Simulator tests
pytest tests/simulator/ -vv
# StreamWise core tests
pytest tests/streamwise/ -vv
# Individual StreamWise app tests (e.g. StreamCast)
pytest tests/streamwise_app/test_streamcast.py -vv
# Full coverage report
coverage combine --keep .coverage.*
coverage xml -o coverage.xml --ignore-errorsAdd new tests in the matching tests/ sub-directory. Mirror the mock pattern used in tests/ (e.g. k8s_mock.py, torch_mock.py) to avoid GPU/cloud dependencies in unit tests.
Must / Never rules
- Must: add or update tests for every functional change.
- Must: keep
services.jsonvalid JSON; validate withpython -m json.tool services.json. - Must: run
flake8andmypybefore committing. - Never: commit Azure credentials, HuggingFace tokens, or other secrets.
- Never: modify files under
deployment/without readingdeployment/README.mdfirst. - Never: change the K8s namespace away from
rtgenwithout updating every reference. - Never: remove or weaken existing tests.
AKS Cluster Deployment & Management
For full step-by-step instructions, read these files in order:
deployment/set_properties.sh– Fill in and source this first (source deployment/set_properties.sh). It defines all Azure and K8s environment variables.deployment/README.md– Overview of all deployment options (AKS recommended, manual K8s, VM+Docker).deployment/acr/README.md– ACR creation and image mirroring. Do this before AKS deployment.deployment/aks/README.md– End-to-end AKS deployment: Bicep cluster creation, credentials, K8s prerequisites, StreamWise/StreamCast pod deployment, GPU node scaling, and troubleshooting.deployment/helm/README.md– Helm-based deployment of GPU model microservices (alternative to StreamWise REST API).deployment/aks/aks.bicep– Bicep template source; review for available parameters and GPU VM sizes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

