# Clone the repository
git clone https://github.com/tiberius1701d/paramem.git
cd paramem
# Option 1: pip install (editable)
pip install -e ".[dev]"
# Option 2: conda (the env file provides the interpreter; the package installs with pip)
conda env create -f environment.yml
conda activate paramem
pip install -e ".[dev]"# What CI runs (CPU only, per-test timeout enforced)
pytest tests/ -v --timeout=60 -m "not gpu"
# Specific test file
pytest tests/test_entry_format.py -v
# Quick check
pytest tests/ -x -qThe integration-marked tests shell out to the installed paramem console script and skip unless it is found; set PARAMEM_BINARY to your environment's copy to run them.
We use ruff for linting and formatting.
# Check for lint errors
ruff check paramem/ tests/ experiments/ scripts/
# Auto-fix lint errors
ruff check --fix paramem/ tests/ experiments/ scripts/
# Check formatting
ruff format --check paramem/ tests/ experiments/ scripts/
# Apply formatting
ruff format paramem/ tests/ experiments/ scripts/Configuration is in pyproject.toml:
- Line length: 100
- Target: Python 3.11
- Rules: E (pycodestyle errors), F (pyflakes), W (pycodestyle warnings), I (isort)
Experiments require a GPU with 8GB+ VRAM:
export PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True
# Smoke test — trains a tiny procedural adapter (attention + MLP target modules)
# and asserts loss drops without CUDA OOM on 8 GB VRAM
python experiments/smoke_procedural_mlp.py
# Post-install REST smoke (needs a running server, debug: true, PARAMEM_API_TOKEN)
python examples/quick_start.pyPrompts are editable without a code change — every LLM-touching pipeline stage reads its prompt from configs/prompts/ (see Tuning prompts below). One exception: configs/prompts/trained_recall.txt is the exact text every adapter was trained on. A test pins it; changing it means retraining every adapter and updating the pin in the same change.
scripts/dev/calibrate_prompts.py drives the /calibrate/* endpoints against a running server, so a prompt edit can be validated live without touching training code. enrich, plausibility, and any extract run not stopped before enrichment need cloud egress and are refused without it. normalize places a real, billed provider call when cloud egress is permitted and runs on the local model otherwise. respond runs a full serving turn: it can actuate a Home Assistant device and place a billed cloud call. The endpoints are gated behind consolidation.calibrate_endpoint_enabled (default off) — see DEPLOYMENT.md for the full /calibrate/* reference.
The default pytest tests/ run auto-deselects @pytest.mark.gpu tests (see tests/conftest.py) so the CPU-only suite never touches CUDA. To opt in:
# Run everything, including GPU-marked tests
pytest --gpu
# Run only GPU-marked tests
pytest -m gpu- Fork the repository and create a feature branch
- Make your changes
- Ensure all tests pass:
pytest tests/ -v --timeout=60 -m "not gpu" - Ensure lint is clean:
ruff check paramem/ tests/ experiments/ scripts/ - Ensure formatting is clean:
ruff format --check paramem/ tests/ experiments/ scripts/ - Write a clear PR description explaining what and why
- Submit the PR
Open a GitHub issue using the Bug Report or Feature Request template and fill in every field — the environment section in particular. A bug without steps to reproduce and the exact package versions usually cannot be acted on.