You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: auto-generate YAML config templates from schema, CLI bug fix
Bug fix:
- CLI crash on --load-pattern + --target-qps (IndexError) — LoadPattern.type
used alias= instead of name= on cyclopts.Parameter
Template generation:
- regenerate_templates.py generates minimal + full YAML templates from
Pydantic schema field defaults (no hardcoded values)
- Full templates include inline # comments auto-discovered from
Field(description=) and Enum/Literal annotations
- Minimal templates: required fields + placeholders only
- Pre-commit hook auto-regenerates on schema changes; CI validates via
CI env var detection (check-only mode)
- init command uses model_dump(exclude_none=True) for offline/online/
concurrency; falls back to handwritten templates for eval/submission
Schema improvements:
- Added Field(description=) to all HTTPClientConfig, AccuracyConfig fields
- New ScorerMethod enum (pass_at_1, string_match, rouge, code_bench_scorer,
shopify_category_f1) for AccuracyConfig.eval_method
Tests:
- Hypothesis fuzz: 4000 random CLI flag combinations
- Unit: all templates validate via from_yaml_file (auto-discovered glob)
- Integration: generated templates run e2e against echo server
- Init command: all 5 types tested
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
entry: python -c "from pathlib import Path; from inference_endpoint.config.schema import BenchmarkConfig; [BenchmarkConfig.from_yaml_file(f) for f in sorted(Path('src/inference_endpoint/config/templates').glob('*.yaml'))]"
51
+
- id: regenerate-templates
52
+
name: Regenerate YAML templates from schema defaults
All of these hooks run automatically on commit: trailing-whitespace, end-of-file-fixer, check-yaml, check-merge-conflict, debug-statements, `ruff` (lint + autofix), `ruff-format`, `mypy`, `prettier` (YAML/JSON/Markdown), license header enforcement.
-`regenerate-templates`: auto-regenerates YAML config templates from schema defaults when `schema.py`, `config.py`, or `regenerate_templates.py` change
208
217
209
218
**Always run `pre-commit run --all-files` before committing.**
Copy file name to clipboardExpand all lines: docs/DEVELOPMENT.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -273,6 +273,21 @@ pytest -s -v
273
273
python -m pdb -m pytest test_file.py
274
274
```
275
275
276
+
## YAML Config Templates
277
+
278
+
Config templates in `src/inference_endpoint/config/templates/` are auto-generated from schema defaults. When you change `config/schema.py`, regenerate them:
279
+
280
+
```bash
281
+
python scripts/regenerate_templates.py
282
+
```
283
+
284
+
The pre-commit hook auto-regenerates templates when `schema.py`, `config.py`, or `regenerate_templates.py` change. CI validates templates are up to date via `--check` mode.
285
+
286
+
Two variants are generated per mode (offline, online, concurrency):
287
+
288
+
-`_template.yaml` — minimal: only required fields + placeholders
289
+
-`_template_full.yaml` — all fields with schema defaults + inline `# options:` comments
0 commit comments