-
Notifications
You must be signed in to change notification settings - Fork 4
fix: CLI crash + auto-generate YAML config templates from schema #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
37d3e04
db7df0c
a7b2bf4
3fcf6ae
fe74d18
640e904
91121d9
0406f34
c479056
82dd0b1
7711dd4
d117d66
f4e308b
56be519
c89e1ae
c77cc1b
0766eca
348cc54
11fefc7
ef9e868
3feeddc
b7f81ad
72691e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -158,7 +158,7 @@ src/inference_endpoint/ | |||||
| │ ├── ruleset_registry.py # Ruleset registry | ||||||
| │ ├── user_config.py # UserConfig dataclass for ruleset user overrides | ||||||
| │ ├── rulesets/mlcommons/ # MLCommons-specific rules, datasets, models | ||||||
| │ └── templates/ # YAML config templates (offline, online, eval, etc.) | ||||||
| │ └── templates/ # YAML config templates (_template.yaml minimal, _template_full.yaml all defaults) | ||||||
| ├── openai/ # OpenAI-compatible API types and adapters | ||||||
| │ ├── types.py # OpenAI response types | ||||||
| │ ├── openai_adapter.py # Request/response adapter | ||||||
|
|
@@ -209,6 +209,7 @@ All of these run automatically on commit: | |||||
| - `mypy` type checking | ||||||
| - `prettier` for 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 | ||||||
|
||||||
| - `regenerate-templates`: auto-regenerates YAML config templates from schema defaults when `schema.py`, `config.py`, or `regenerate_templates.py` change | |
| - `regenerate-templates`: auto-regenerates YAML config templates from schema defaults when `schema.py`, `endpoint_client/config.py`, or `regenerate_templates.py` change |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -79,9 +79,8 @@ inference-endpoint validate-yaml -c test.yaml | |||||
| ### Utilities | ||||||
|
|
||||||
| ```bash | ||||||
| # Generate config templates | ||||||
| inference-endpoint init offline # or: online, eval, submission | ||||||
| inference-endpoint init submission | ||||||
| # Generate config template (all fields with defaults) | ||||||
|
||||||
| # Generate config template (all fields with defaults) | |
| # Generate config template (common defaults; fields with null/None defaults may be omitted) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -276,6 +276,21 @@ pytest -s -v | |
| python -m pdb -m pytest test_file.py | ||
| ``` | ||
|
|
||
| ## 📄 YAML Config Templates | ||
|
|
||
| Config templates in `src/inference_endpoint/config/templates/` are auto-generated from schema defaults. When you change `config/schema.py`, regenerate them: | ||
|
|
||
| ```bash | ||
| python scripts/regenerate_templates.py | ||
| ``` | ||
|
|
||
| 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. | ||
|
|
||
|
Comment on lines
+281
to
+288
|
||
| Two variants are generated per mode (offline, online, concurrency): | ||
|
|
||
| - `_template.yaml` — minimal: only required fields + placeholders | ||
| - `_template_full.yaml` — all fields with schema defaults + inline `# options:` comments | ||
|
|
||
| ## 📦 Package Management | ||
|
|
||
| ### Adding Dependencies | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.