Contributing¶
Development Setup¶
git clone https://github.com/aallbrig/assgen.git
cd assgen
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,docs]"
Run tests:
Run linter:
Adding a New Inference Handler¶
Handlers live under src/assgen/server/handlers/. Each handler is a module
that exposes a single async function:
async def run(params: dict, model_path: str, device: str) -> dict:
"""Run inference and return output paths/data."""
...
Steps:
- Create
src/assgen/server/handlers/my_task.pyimplementingrun(). - Add an entry to
src/assgen/catalog.yaml: - Add the task to
src/assgen/tasks.pyin the appropriate domain. - Add a client sub-command under
src/assgen/client/commands/. - Wire the sub-command into the parent Typer app.
- Add compatibility tags in
TASK_COMPATIBLE_TAGS(src/assgen/server/validation.py) if introducing a new task category. - Write tests in
tests/.
Google-style Docstrings¶
All public functions should use Google-style docstrings so that
mkdocstrings can render them correctly in the API reference:
def my_function(model_id: str, params: dict) -> Path:
"""One-line summary.
Longer description if needed.
Args:
model_id: HuggingFace model identifier in ``org/repo`` format.
params: Arbitrary key/value pairs passed by the client.
Returns:
Local path to the generated output file.
Raises:
ValueError: If ``model_id`` is not compatible with this task.
Example:
>>> path = my_function("stabilityai/TripoSR", {"prompt": "sword"})
"""
Docs¶
Build the docs site locally:
The docs are auto-deployed to GitHub Pages on every push to main and on
every version tag via the CI workflows in .github/workflows/.
Recording Demo Videos¶
The project uses VHS to produce a
single MP4 showcasing CLI features. Individual feature segments are recorded
as separate .tape files, then stitched into one video with ffmpeg.
Prerequisites¶
- VHS (
go install github.com/charmbracelet/vhs@latest) ffmpeg(bundled with VHS, or install separately)assgeninstalled and on$PATH(pip install -e .)
Recording¶
Individual tapes live in demos/. To re-record a single segment:
Adding a New Feature Demo¶
- Create
demos/NN_<name>.tapefollowing the existing pattern Source demos/_settings.tapeat the top for consistent visuals- Set
Output demos/segments/NN_<name>.mp4 - Run
make demoto verify the new segment integrates correctly
Release Process¶
- Ensure all tests pass on
main. - Tag a version:
git tag v0.x.y && git push --tags - The
release.ymlworkflow builds the wheel, runs tests, builds docs, and creates a GitHub Release with all assets attached automatically.