docs(observability): add Dynamic Model Router integration page#5803
docs(observability): add Dynamic Model Router integration page#5803manthan9891994 wants to merge 3 commits into
Conversation
Adds a docs page under Observability for dynamic-model-router, a pre-call task classifier that picks the cheapest model tier (low/medium/high) for each CrewAI agent call before any API request is made. Sits as a peer to portkey.mdx in the cost-optimization / routing category, but runs in-process with no proxy. Drop-in DynamicLLM replacement, 3-layer cascade (keywords -> frozen MiniLM -> LLM fallback), classifies in <15ms. Doc page is explicit that savings depend on the user's traffic mix and how they tune the cascade for their domain. Files: - docs/en/observability/dynamic-model-router.mdx (new page, follows portkey.mdx template) - docs/pt-BR/observability/dynamic-model-router.mdx (translation parity) - docs/ko/observability/dynamic-model-router.mdx (translation parity) - docs/ar/observability/dynamic-model-router.mdx (translation parity) - docs/docs.json (nav entries under Observability for all 4 locales) PyPI: https://pypi.org/project/dynamic-model-router/ Repo: https://github.com/manthan9891994/agents-multi-model-support
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a new English observability documentation page describing how to integrate the Dynamic Model Router with CrewAI, explaining its pre-call routing cascade behavior and telemetry features. The page is then registered across multiple navigation sections in the docs.json manifest. ChangesDynamic Model Router Documentation (English)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (4)
docs/en/observability/dynamic-model-router.mdx (1)
93-98:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winAdd missing newline at end of file.
The file should end with a newline character for POSIX compliance and to avoid issues with some tools.
📝 Proposed fix
- **License**: MIT +🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/en/observability/dynamic-model-router.mdx` around lines 93 - 98, The file ends without a trailing newline; update the document (the Resources section in dynamic-model-router.mdx) to ensure the file terminates with a single newline character (POSIX-compliant EOF newline) by adding a newline at the very end of the file so tools and linters recognize the final line break.docs/pt-BR/observability/dynamic-model-router.mdx (1)
1-98:⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy liftThe pt-BR file contains untranslated English content.
This file is in the
docs/pt-BR/directory but contains English text throughout. The title, description, introduction, explanations, and all prose should be translated to Portuguese (Brazil). Only code examples and technical terms like API names should remain in English.This affects the entire documentation experience for Portuguese-speaking users.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/pt-BR/observability/dynamic-model-router.mdx` around lines 1 - 98, Translate all English prose in this file into Brazilian Portuguese: the frontmatter title and description, headings (Introduction, Why it helps, Resources), all paragraph text, bullet points, Step titles and explanatory text inside the Steps block, and the explanatory sentences around code examples; leave code blocks, inline code identifiers and technical/API names unchanged (e.g., DynamicLLM, Router, StdoutLoggerBackend, Crew, Agent, Task, crew.kickoff(), PyPI/GitHub links, package names) and keep URLs intact; ensure the translated text preserves meaning and tone for documentation readers and that examples, punctuation and markup (Steps/Step tags, backticks) remain unchanged.docs/ko/observability/dynamic-model-router.mdx (1)
1-98:⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy liftThe ko file contains untranslated English content.
This file is in the
docs/ko/directory but contains English text throughout. The entire documentation should be translated to Korean, with only code examples and technical API names remaining in English.This affects the entire documentation experience for Korean-speaking users.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ko/observability/dynamic-model-router.mdx` around lines 1 - 98, The Korean doc file currently contains English content; translate all visible English text into Korean (frontmatter title/description, headings, paragraphs, bullet lists, and Step titles/descriptions) while leaving code blocks and technical API/class names unchanged — preserve identifiers like Dynamic Model Router, DynamicLLM, Router, StdoutLoggerBackend, Crew, Agent, Task, and any code samples exactly as-is; ensure the translated Korean copy maintains the original meaning and structure (Introduction, Installation & Setup, Why it helps, Resources) and that links, code fences, and examples remain intact and unmodified.docs/ar/observability/dynamic-model-router.mdx (1)
1-98:⚠️ Potential issue | 🔴 Critical | 🏗️ Heavy liftThe ar file contains untranslated English content.
This file is in the
docs/ar/directory but contains English text throughout. The entire documentation should be translated to Arabic, with only code examples and technical API names remaining in English. Additionally, Arabic is a right-to-left (RTL) language, which may require special formatting considerations for the MDX layout.This affects the entire documentation experience for Arabic-speaking users.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/ar/observability/dynamic-model-router.mdx` around lines 1 - 98, The Arabic documentation page titled "Dynamic Model Router Integration" contains English content; translate the entire prose into Arabic while leaving code blocks and technical identifiers (e.g., DynamicLLM, Router, StdoutLoggerBackend, Crew, Agent, Task, kickoff) in English, and ensure MDX structure elements like Steps/Step titles are localized; also adjust the page for RTL rendering (flip layout-sensitive text, set dir="rtl" or use appropriate MDX RTL wrapper) so Arabic reads correctly without altering code examples or API names.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/en/observability/dynamic-model-router.mdx`:
- Around line 79-80: The example instantiates Router and DynamicLLM separately
but never wires them together; update the example to pass the Router into the
DynamicLLM (e.g., create router = Router(decision_logger=StdoutLoggerBackend())
and then construct the LLM with that router by calling DynamicLLM(router=router)
or assign llm.router = router after construction) so readers see the complete
wiring between Router, StdoutLoggerBackend, and DynamicLLM.
---
Outside diff comments:
In `@docs/ar/observability/dynamic-model-router.mdx`:
- Around line 1-98: The Arabic documentation page titled "Dynamic Model Router
Integration" contains English content; translate the entire prose into Arabic
while leaving code blocks and technical identifiers (e.g., DynamicLLM, Router,
StdoutLoggerBackend, Crew, Agent, Task, kickoff) in English, and ensure MDX
structure elements like Steps/Step titles are localized; also adjust the page
for RTL rendering (flip layout-sensitive text, set dir="rtl" or use appropriate
MDX RTL wrapper) so Arabic reads correctly without altering code examples or API
names.
In `@docs/en/observability/dynamic-model-router.mdx`:
- Around line 93-98: The file ends without a trailing newline; update the
document (the Resources section in dynamic-model-router.mdx) to ensure the file
terminates with a single newline character (POSIX-compliant EOF newline) by
adding a newline at the very end of the file so tools and linters recognize the
final line break.
In `@docs/ko/observability/dynamic-model-router.mdx`:
- Around line 1-98: The Korean doc file currently contains English content;
translate all visible English text into Korean (frontmatter title/description,
headings, paragraphs, bullet lists, and Step titles/descriptions) while leaving
code blocks and technical API/class names unchanged — preserve identifiers like
Dynamic Model Router, DynamicLLM, Router, StdoutLoggerBackend, Crew, Agent,
Task, and any code samples exactly as-is; ensure the translated Korean copy
maintains the original meaning and structure (Introduction, Installation &
Setup, Why it helps, Resources) and that links, code fences, and examples remain
intact and unmodified.
In `@docs/pt-BR/observability/dynamic-model-router.mdx`:
- Around line 1-98: Translate all English prose in this file into Brazilian
Portuguese: the frontmatter title and description, headings (Introduction, Why
it helps, Resources), all paragraph text, bullet points, Step titles and
explanatory text inside the Steps block, and the explanatory sentences around
code examples; leave code blocks, inline code identifiers and technical/API
names unchanged (e.g., DynamicLLM, Router, StdoutLoggerBackend, Crew, Agent,
Task, crew.kickoff(), PyPI/GitHub links, package names) and keep URLs intact;
ensure the translated text preserves meaning and tone for documentation readers
and that examples, punctuation and markup (Steps/Step tags, backticks) remain
unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99bff061-17ff-4d2c-a310-9c47e2d7c08e
📒 Files selected for processing (5)
docs/ar/observability/dynamic-model-router.mdxdocs/docs.jsondocs/en/observability/dynamic-model-router.mdxdocs/ko/observability/dynamic-model-router.mdxdocs/pt-BR/observability/dynamic-model-router.mdx
Address coderabbit feedback: the prior 'Optional telemetry' example instantiated Router and DynamicLLM separately without wiring them together, which was misleading. Replaced with two accurate options: DMR_TELEMETRY env-var path (no code changes) and direct Router.classify path for persistent backends.
There was a problem hiding this comment.
Actionable comments posted: 4
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/ar/observability/dynamic-model-router.mdx`:
- Around line 2-115: The page under the Arabic locale is entirely in English;
translate the whole document (frontmatter title/description, all headings,
prose, step titles and code comments) into Arabic while preserving identifiers
and API names (e.g., Dynamic Model Router, DynamicLLM, Router, DMR_TELEMETRY,
StdoutLoggerBackend) and keeping code blocks unchanged; ensure translated step
titles within the <Steps>/<Step> sections, the introduction, "Why it helps",
"Resources" and frontmatter (title/description) are fully localized to Arabic
and that links and examples remain intact.
In `@docs/en/observability/dynamic-model-router.mdx`:
- Line 12: The cascade layer labels are inconsistent: update the text "L1
keywords (<1ms) → L3 frozen MiniLM ML head (~15ms) → L2 LLM fallback (~500ms)"
so the labels follow the documented sequence (keyword → MiniLM → LLM fallback);
e.g., change to "L1 keywords (<1ms) → L2 frozen MiniLM ML head (~15ms) → L3 LLM
fallback (~500ms)" to make the layer numbering consistent.
In `@docs/ko/observability/dynamic-model-router.mdx`:
- Around line 2-115: The page is in English but must be fully localized to
Korean: translate the frontmatter fields (title, description, icon labels if
user-facing) and every user-facing string in the body — headings
("Introduction", "Installation & Setup", "Why it helps", "Resources"), bullet
texts, step titles ("Install the required packages", "Configure CrewAI with the
Dynamic Model Router", "Optional — enable telemetry"), code comments/strings
shown to users (e.g., example output, log instructions mentioning
DMR_TELEMETRY), and link labels so the entire document under the ko locale is
Korean while keeping identifiers like DynamicLLM, Router, StdoutLoggerBackend,
DMR_TELEMETRY, PyPI/GitHub links unchanged.
In `@docs/pt-BR/observability/dynamic-model-router.mdx`:
- Around line 2-115: Translate all English copy between lines 2–115 into
Brazilian Portuguese while preserving the file frontmatter, headings,
formatting, code blocks and inline links; keep identifiers and symbols unchanged
(e.g., "Dynamic Model Router", "DynamicLLM", "DMR_TELEMETRY", "Router",
"StdoutLoggerBackend") and only localize the human-readable text, descriptions,
step titles, bullet points and explanatory paragraphs so the pt-BR doc reads
naturally for Portuguese-speaking users.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ffb34b83-3f89-4382-802e-5b31f4ca6897
📒 Files selected for processing (4)
docs/ar/observability/dynamic-model-router.mdxdocs/en/observability/dynamic-model-router.mdxdocs/ko/observability/dynamic-model-router.mdxdocs/pt-BR/observability/dynamic-model-router.mdx
Per coderabbit feedback: shipping English content under ko/ar/pt-BR locale routes is misleading. Removing the placeholder copies and their nav entries so the English page is the single source of truth. Translation parity will follow as separate PRs by native speakers.
Adds a docs page under Observability for dynamic-model-router, a pre-call task classifier that picks the cheapest model tier (low/medium/high) for each CrewAI agent call before any API request is made. Sits as a peer to portkey.mdx in the cost-optimization / routing category, but runs in-process with no proxy.
Drop-in DynamicLLM replacement, 3-layer cascade (keywords -> frozen MiniLM -> LLM fallback), classifies in <15ms. Doc page is explicit that savings depend on the user's traffic mix and how they tune the cascade for their domain.
Files:
PyPI: https://pypi.org/project/dynamic-model-router/
Repo: https://github.com/manthan9891994/agents-multi-model-support
Summary by CodeRabbit