agentleFS
Microsoft AzureKnown publisherAzure/realtimevideogen/AGENTS.md

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.

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
  1. Very specific:

    Namespace: all K8s resources go in namespace rtgen (set via $K8S_NAMESPACE).

    line 27
  2. Distinctive:

    GPU spot node pools: start at 0 nodes to save cost.

    line 31
  3. Very specific:

    ACR attachment: prefer az aks update --attach-acr over imagePullSecrets when using AKS.

    line 32
  4. Very specific:

    Async: use async/await and aiofiles for all I/O-bound work.

    line 43
  5. Very specific:

    Logging: use the colorlog-based logger from console_utils.py.

    line 44
  6. Common:

    No secrets in source: never hard-code tokens, passwords, or subscription IDs.

    line 46
  7. Distinctive:

    Run these before opening a pull request:

    line 50
  8. Very specific:

    Add new tests in the matching tests/ sub-directory.

    line 96
  9. Distinctive:

    Must: add or update tests for every functional change.

    line 100
  10. Very specific:

    Must: keep services.json valid JSON.

    line 101
  11. Very specific:

    Must: run flake8 and mypy before committing.

    line 102
  12. Common:

    Never: commit Azure credentials, HuggingFace tokens, or other secrets.

    line 103
  13. Distinctive:

    Never: remove or weaken existing tests.

    line 106

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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

PathPurpose
services.jsonRegistry 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.shCentral 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 from services.json.
  • Pod YAMLs in deployment/aks/ use shell variable placeholders (${ACR_URL}, ${LOAD_BALANCER_IP}, ${RESOURCE_GROUP_NAME}). Deploy with envsubst < file.yaml | kubectl apply -f -.
  • Helm chart in deployment/helm/ reads image tags from services.json via the deploy.sh script.
  • 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-acr over imagePullSecrets when using AKS.

Development Guide

Python coding standards

  • Python version: 3.12.
  • Type annotations: required on every function signature (disallow_untyped_defs = True in mypy.ini). Never use bare Any without justification.
  • Line length: maximum 120 characters (enforced by flake8).
  • Async: use async/await and aiofiles for all I/O-bound work. The web framework is Quart (async Flask).
  • Logging: use the colorlog-based logger from console_utils.py; pass extra={"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 || true

Testing

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-errors

Add 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.json valid JSON; validate with python -m json.tool services.json.
  • Must: run flake8 and mypy before committing.
  • Never: commit Azure credentials, HuggingFace tokens, or other secrets.
  • Never: modify files under deployment/ without reading deployment/README.md first.
  • Never: change the K8s namespace away from rtgen without updating every reference.
  • Never: remove or weaken existing tests.

AKS Cluster Deployment & Management

For full step-by-step instructions, read these files in order:

  1. deployment/set_properties.sh – Fill in and source this first (source deployment/set_properties.sh). It defines all Azure and K8s environment variables.
  2. deployment/README.md – Overview of all deployment options (AKS recommended, manual K8s, VM+Docker).
  3. deployment/acr/README.md – ACR creation and image mirroring. Do this before AKS deployment.
  4. deployment/aks/README.md – End-to-end AKS deployment: Bicep cluster creation, credentials, K8s prerequisites, StreamWise/StreamCast pod deployment, GPU node scaling, and troubleshooting.
  5. deployment/helm/README.md – Helm-based deployment of GPU model microservices (alternative to StreamWise REST API).
  6. deployment/aks/aks.bicep – Bicep template source; review for available parameters and GPU VM sizes.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.