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
docs(evaluator): fix submit() packager, FilesetRef import, and leaked titles (#406)
* docs(evaluator): fix SDK submit() examples, FilesetRef import, ModelRef, and leaked titles
The Evaluator docs drifted from the current plugin SDK contract. This brings
the runnable snippets back in line and fixes two broken tutorial titles.
- submit(): add the now-required `metric_bundle_packager=CloudpickleMetricBundlePackager()`
(and its import) to every runnable `evaluator.submit(...)` example across
index, sdk-resources, and the metrics/* and tutorials/* pages. `run()`
examples are unchanged (they do not take the packager).
- LLM Judge tutorial: import `FilesetRef` from `nemo_evaluator.sdk` instead of
the non-existent `nemo_evaluator_sdk.values.FilesetRef`.
- model-configuration: document that local `run()` requires an inline `Model`
while remote `submit()` also accepts a `ModelRef`.
- test_doc_examples.py: replace the stale `/v2/...` REST script with offline
contract checks for the import paths and the submit() packager requirement.
- Fix two tutorial pages that rendered `@nemo-nb: hide` as the page title
(leaked cell marker in frontmatter `title`); set real titles and drop the
duplicate body H1, matching every other evaluator page.
Verified: `make docs-check` and `make docs-broken-links` pass; ruff/ty clean;
the new contract test passes (7/7); both tutorial titles confirmed via the Fern
dev-server render.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Sandy Chapman <schapman@nvidia.com>
* docs(evaluator): fix ModelRef submit example config + shorten test name
Address review feedback on #406:
- ModelRef submit example now passes config=RunConfigOnlineModel(). A ModelRef
target generates outputs online, and _submit_params raises
TypeError("ModelRef target requires RunConfigOnlineModel") otherwise — so the
example was not runnable. (CodeRabbit flagged this; its suggested fix used
params=/the plugin import path — the public submit() keyword is config= and
the value type is imported from nemo_evaluator_sdk like the other docs.)
- Rename test_submit_exposes_metric_bundle_packager_but_run_does_not to
test_packager_param_is_submit_only (reviewer: name too long).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Sandy Chapman <schapman@nvidia.com>
---------
Signed-off-by: Sandy Chapman <schapman@nvidia.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/evaluator/metrics/model-configuration.mdx
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,43 @@ Use plain `RunConfig` for offline evaluations where the dataset already contains
183
183
184
184
## Model References
185
185
186
-
The plugin SDK examples on this page use inline `Model` objects. If your deployment resolves platform model entities into model endpoint details, perform that lookup before constructing the `Model`, then pass the resulting inline model to the metric or request.
186
+
You can supply the evaluation target two ways. Which one is valid depends on whether you run the evaluation locally or submit it as a durable platform job.
187
+
188
+
### Inline `Model` (required for `evaluator.run(...)`)
189
+
190
+
`evaluator.run(...)` executes in your local Python process, so it needs the resolved endpoint details inline. Always pass an inline `Model` as the `target` (or as a judge/embeddings field on the metric). If your deployment stores platform model entities, resolve the entity into endpoint details before constructing the `Model`:
result = evaluator.run(metric=metric, dataset=dataset, target=model)
203
+
```
204
+
205
+
### `ModelRef` (supported by `evaluator.submit(...)`)
206
+
207
+
Durable remote `evaluator.submit(...)` jobs additionally accept a `ModelRef` target. A `ModelRef` names a platform model entity (`workspace/model-name`) and is resolved by the evaluator backend when the job runs, so you do not have to resolve the endpoint yourself. Use this for platform-managed model routing. A `ModelRef` target generates outputs online, so it requires an online run config (`RunConfigOnlineModel`):
208
+
209
+
```python
210
+
from nemo_evaluator_sdk import ModelRef, RunConfigOnlineModel
211
+
from nemo_evaluator.shared.metric_bundles.cloudpickle import CloudpickleMetricBundlePackager
`ModelRef` is **not** valid for `evaluator.run(...)`; the local runtime cannot resolve a platform entity. Pass an inline `Model` for local runs and either a `Model` or a `ModelRef` for remote submits. See the [Define and Run Custom Python Metrics](/documentation/evaluate-models/tutorials/define-and-run-custom-python-metrics) tutorial for an end-to-end `ModelRef` + `FilesetRef` submit example.
0 commit comments