Geti Library Development
For the full architecture reference (package layout, multi-backend design, how to add models, recipes, and manifests) read
library/AGENTS.md.
Quick Start
- Work from
library/. - Create or refresh the environment with
just venv --device cpufor routine work. - Switch to
just venv --device cudaorjust venv --device xpuonly when the task needs accelerator-specific behavior. - Run
just lintbefore wider test runs.
Architecture Essentials
- Source lives under
src/getitune/. Public API entry points must stay stable becauseapplication/backend/consumes them. - Multi-backend design: compute backends live under
src/getitune/backend/—lightning/(PyTorch Lightning training),openvino/(inference-only), and optionalultralytics/.src/getitune/models/re-exports model classes from each backend into one namespace. - Device abstraction:
DeviceType(src/getitune/types/device.py) andDeviceConfig(src/getitune/config/device.py) abstract accelerator choice. Guard device-specific (CUDA vs XPU) code with capability checks insrc/getitune/utils/device.py— never at import time. - Recipes: YAML configs under
src/getitune/recipe/<task>/<model>.yamlbind a task + modelclass_path+ training config. Recipes are self-discovering viasrc/getitune/utils/recipes.py(list_models) — no registry to update. - Adding a model: implement the model class under
src/getitune/backend/lightning/models/<task>/, inheriting the task base class (ultimatelyLightningModel); export it from the task__init__.py; add a recipe YAML. Seelibrary/AGENTS.mdfor the full walkthrough.
Workflow
- Confirm the change belongs in
library/. If the task is mainly FastAPI or React work, switch to the matching backend or UI skill. - Inspect the nearest module and tests before editing. Keep changes inside the existing package boundaries under
src/getitune/. - Make the smallest change that resolves the task. Avoid lockfile churn unless dependencies changed intentionally.
- Run the smallest relevant checks first and widen only if the changed behavior crosses package or task boundaries.
Verification
- Use
just lintfor formatting, lint, and type issues. - Use
just test-unit -- tests/unit/...orjust test-unit -- -k <expr>for normal Python behavior changes. - Use the backend-scoped recipes for model code:
just test-unit-lightning -- <pytest args>,just test-unit-ultralytics -- <pytest args>, orjust test-unit-openvino -- <pytest args>. - Use
just test-integration -- <pytest args>only when the change affects end-to-end training, export, or integration behavior.
Coordination Notes
application/backendconsumes../../libraryas a local editable dependency. If the change affects shared runtime behavior, validate the backend too.- Update docs or examples when public library behavior changes.
- Prefer project
justtargets over ad hoc dependency-install commands so the pinneduvworkflow stays consistent with CI.