Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
37d3e04
fix: CLI crash on --load-pattern + --target-qps, add fuzz tests and CI
viraatc Apr 3, 2026
db7df0c
update
viraatc Apr 7, 2026
a7b2bf4
chore: auto-generate minimal + full YAML config templates from schema
viraatc Apr 8, 2026
3fcf6ae
chore: remove --full flag from init, update stale docs
viraatc Apr 8, 2026
fe74d18
docs: fix remaining stale references
viraatc Apr 8, 2026
640e904
fix: revert init output filename to {type}_template.yaml
viraatc Apr 8, 2026
91121d9
chore: simplify template integration test overrides
viraatc Apr 8, 2026
0406f34
chore: simplify templates — 1 endpoint, minimal test overrides, accur…
viraatc Apr 8, 2026
c479056
update
viraatc Apr 8, 2026
82dd0b1
fix: restore eval/submission in init command
viraatc Apr 8, 2026
7711dd4
fix: handle eval/submission templates explicitly in init
viraatc Apr 8, 2026
d117d66
chore: add TODO for auto-generating eval/submission templates
viraatc Apr 8, 2026
f4e308b
update
viraatc Apr 8, 2026
56be519
update
viraatc Apr 8, 2026
c89e1ae
chore: revert eval/submission auto-generation, CI check-only mode
viraatc Apr 8, 2026
c77cc1b
Update
viraatc Apr 8, 2026
0766eca
fix: pre-commit regex to match template files, not just directory
viraatc Apr 8, 2026
348cc54
chore: init uses model_dump(exclude_none=True) instead of copying tem…
viraatc Apr 8, 2026
11fefc7
feat: auto-generate CONFIG_REFERENCE.md from Pydantic schema
viraatc Apr 8, 2026
ef9e868
chore: remove unused _ensure_trailing_newline
viraatc Apr 8, 2026
3feeddc
chore: remove CONFIG_REFERENCE.md generator (not ready for merge)
viraatc Apr 8, 2026
b7f81ad
fix: address PR review comments
viraatc Apr 8, 2026
72691e2
chore: add field descriptions to full templates, runtime to minimal
viraatc Apr 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,44 @@ jobs:
python -m pip install pip==26.0.1
pip install -e ".[dev,test,performance]"
pip-audit

schema-updated:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0

- name: Check for schema changes
id: schema
run: |
CHANGED=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- \
'src/inference_endpoint/config/schema.py' \
'src/inference_endpoint/endpoint_client/config.py' \
'src/inference_endpoint/commands/benchmark/cli.py' \
'scripts/regenerate_templates.py' \
'src/inference_endpoint/config/templates/*.yaml')
echo "changed=$([[ -n "$CHANGED" ]] && echo true || echo false)" >> "$GITHUB_OUTPUT"

- name: Set up Python 3.12
if: steps.schema.outputs.changed == 'true'
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"

- name: Install dependencies
if: steps.schema.outputs.changed == 'true'
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"

- name: Run schema fuzz tests
if: steps.schema.outputs.changed == 'true'
run: |
pytest -xv -m schema_fuzz

- name: Check YAML templates are up to date
if: steps.schema.outputs.changed == 'true'
run: |
python scripts/regenerate_templates.py --check
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
hooks:
- id: prettier
types_or: [yaml, json, markdown]
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py|src/inference_endpoint/openai/openapi.yaml)$
exclude: ^(src/inference_endpoint/openai/openai_types_gen.py|src/inference_endpoint/openai/openapi.yaml|src/inference_endpoint/config/templates/)

- repo: local
hooks:
Expand All @@ -48,12 +48,12 @@ repos:
args: ["--tb=short", "--strict-markers"]
stages: [manual]

- id: validate-templates
name: Validate YAML templates against schema
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'))]"
- id: regenerate-templates
name: Regenerate YAML templates from schema defaults
entry: python scripts/regenerate_templates.py
language: system
pass_filenames: false
files: ^src/inference_endpoint/config/(schema\.py|templates/)
files: ^(src/inference_endpoint/config/(schema\.py|templates/.*)|src/inference_endpoint/endpoint_client/config\.py|scripts/regenerate_templates\.py)$

- id: add-license-header
name: Add license headers
Expand Down
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regenerate-templates hook is configured to run on src/inference_endpoint/config/schema.py, src/inference_endpoint/endpoint_client/config.py, and scripts/regenerate_templates.py (see .pre-commit-config.yaml). This line mentions a generic config.py, which is ambiguous; consider updating it to the actual path (endpoint_client/config.py) so developers know what triggers regeneration.

Suggested 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

Copilot uses AI. Check for mistakes.

**Always run `pre-commit run --all-files` before committing.**

Expand Down
13 changes: 6 additions & 7 deletions docs/CLI_QUICK_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line claims init generates a template with “all fields with defaults”, but the implementation currently dumps with exclude_none=True, which omits fields whose defaults are None. Either adjust the wording (e.g., “common defaults”) or update init to emit the full template including null defaults.

Suggested change
# Generate config template (all fields with defaults)
# Generate config template (common defaults; fields with null/None defaults may be omitted)

Copilot uses AI. Check for mistakes.
inference-endpoint init offline # or: online, concurrency

# Show system info
inference-endpoint info
Expand Down Expand Up @@ -238,14 +237,14 @@ inference-endpoint benchmark online \

```bash
# 1. Generate template
inference-endpoint init submission
inference-endpoint init offline # or: online, concurrency

# 2. Edit submission_template.yaml (set model, datasets, ruleset, endpoint)
# 2. Edit offline_template.yaml (set model, datasets, endpoint)

# 3. Run (YAML mode)
inference-endpoint benchmark from-config \
--config submission_template.yaml \
--report-dir official_results
--config offline_template.yaml \
--report-dir results
```

### Validate First
Expand Down
15 changes: 15 additions & 0 deletions docs/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs mention a pre-commit trigger on config.py, but the actual hook targets src/inference_endpoint/endpoint_client/config.py (and other files). Please update this list so contributors know which changes will regenerate templates.

Copilot uses AI. Check for mistakes.
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
Expand Down
2 changes: 1 addition & 1 deletion docs/LOCAL_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Cleaning up...
inference-endpoint -v info

# Generate template
inference-endpoint init --template offline
inference-endpoint init offline

# Validate config
inference-endpoint validate-yaml --config offline_template.yaml
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ test = [
"aiohttp==3.13.5",
# Plotting for benchmark sweep mode
"matplotlib==3.10.8",
# Property-based testing (CLI fuzz)
"hypothesis==6.151.10",
]
performance = [
"pytest-benchmark==5.2.3",
Expand Down Expand Up @@ -184,6 +186,7 @@ markers = [
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"run_explicitly: mark test to only run explicitly",
"schema_fuzz: hypothesis CLI fuzz tests (run in CI on schema changes)",
]
filterwarnings = [
"ignore:Session timeout reached:RuntimeWarning",
Expand Down
Loading
Loading