feat: migrate analyze CLI to typed analyzer framework#2375
Draft
ryan-arman wants to merge 2 commits intomainfrom
Draft
feat: migrate analyze CLI to typed analyzer framework#2375ryan-arman wants to merge 2 commits intomainfrom
ryan-arman wants to merge 2 commits intomainfrom
Conversation
Port the oumi analyze CLI from the legacy DatasetAnalyzer path onto the
typed analyzer framework (TypedAnalyzeConfig, AnalysisPipeline,
TestEngine) that already lives in src/oumi/analyze/ on main.
- Rewrite src/oumi/cli/analyze.py to load TypedAnalyzeConfig from YAML,
construct analyzers via the core registry, run AnalysisPipeline, and
optionally execute TestEngine
- Restore --list, --list-metrics, --log-level, --dataset_name,
--dataset_path, --sample_count, --output, --format flags
- Emit a friendly migration error when a v1 AnalyzeConfig YAML is
detected (checks for dataset_source, processor_name, etc.)
- Wire analyze as a nested Typer app in cli/main.py so help panels
render correctly
- Update configs/examples/analyze/analyze.yaml to the v2 schema
- Rewrite docs/user_guides/analyze/{analyze,analyze_config}.md for the
v2 schema
- Exclude configs/examples/analyze/analyze.yaml from the legacy
test_parse_configs sweep (uses TypedAnalyzeConfig, not AnalyzeConfig)
First PR in a 4-PR split of #2370.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Apr 17, 2026
Remove _item_to_conversation's hardcoded prompt/instruction/response/ context key lists and simplify load_conversations_from_dataset to a strict Oumi-format loader (Conversation.from_dict per row, warn-and-skip on failure). Matches the pre-v2 CLI contract of requiring Oumi-shaped data and stays consistent with the api backend, which uses typed schemas or explicit column names rather than field guessing. Update the example YAML and the analyze docs to use placeholder dataset names and note that HF rows must already be in Oumi format; instruction- style datasets should be pre-converted to Oumi JSONL. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Migrates the
oumi analyzeCLI from the legacyDatasetAnalyzerpath onto the typed analyzer framework (TypedAnalyzeConfig+AnalysisPipeline+TestEngine) that already lives insrc/oumi/analyze/on main. First PR of a 4-PR split of #2370 — keeps this change focused on the CLI so the framework refactors, v2 naming alignment, and bug fixes can ship and be reviewed independently.What changed
src/oumi/cli/analyze.pyto loadTypedAnalyzeConfigfrom YAML, build analyzers viaREGISTRY.get_sample_analyzer, runAnalysisPipeline, and optionally executeTestEngine.--list,--list-metrics,--log-level,--dataset_name,--dataset_path,--sample_count,--output,--formatflags with rich help panels.AnalyzeConfig(v1) YAMLs (presence ofdataset_source,processor_name,is_multimodal, etc.) and emit a friendly migration error instead of a cryptic crash.src/oumi/cli/main.pyso subcommands and help panels render.configs/examples/analyze/analyze.yamlto the v2 schema.docs/user_guides/analyze/{analyze,analyze_config}.mdto document the v2 schema.tests/unit/core/configs/test_parse_configs.py.Out of scope (deferred to follow-up PRs)
type/display_namerename inAnalyzerConfig→ PR 2.testing/engine.pyrefactor (localTestConfig→ coreTestParams) + bug fixes (None-index shift, MRO walk,all_affected_indicesrestore) → PR 3.analyze/base.py,analyze/pipeline.pydup-name validation,analyze/discovery.pyhelpers,analyze/utils/dataframe.pyraw-dict handling → PR 4.Verification
pytest tests/unit/cli/test_cli_analyze.py— 7/7 pass.pytest tests/unit/core/configs/test_parse_configs.py— 984/984 pass.oumi analyze --config configs/examples/analyze/analyze.yaml --output /tmp/smoke --format jsonruns end-to-end, producesanalysis.json,test_results.json,summary.json.Related issues
Linear Issue: OPE-1868
Fixes OPE-1868
Before submitting
Reviewers
At least one review from a member of `oumi-ai/oumi-staff` is required.