Skip to content

[feat] migrate to latest provider models and remove deprecated ones#7681

Open
chiruu12 wants to merge 8 commits intoagno-agi:mainfrom
chiruu12:main
Open

[feat] migrate to latest provider models and remove deprecated ones#7681
chiruu12 wants to merge 8 commits intoagno-agi:mainfrom
chiruu12:main

Conversation

@chiruu12
Copy link
Copy Markdown
Contributor

Summary

Updated multiple model providers to newer, actively supported models to prevent upcoming deprecations, improve performance consistency, and significantly reduce operational costs.

Several previously configured models were nearing deprecation deadlines (e.g., Kimi K2 by May 25, Gemini Flash changes by June 1), while others such as GPT-4o are now considered legacy compared to newer, more efficient alternatives.

Additionally, some models (notably from Together AI and Fireworks) have shifted away from serverless availability and now require dedicated deployments, necessitating updates to maintain compatibility and avoid service disruptions.

This update ensures:

  • Forward compatibility with provider roadmaps
  • Lower inference costs through optimized models
  • More stable and production-ready configurations across providers

Model Changes

  • Gemini: moved to gemini-flash-latest to avoid the upcoming Gemini 2.0 Flash deprecation
  • Fireworks: switched from accounts/fireworks/models/llama-v3p1-405b-instruct to accounts/fireworks/models/gpt-oss-120b as the previous model is no longer available for serverless usage
  • xAI (Grok): updated from grok-beta to grok-4-1-fast-non-reasoning-latest for a stable, production-ready model
  • OpenRouter: changed from gpt-4o to gpt-5.4-mini for improved cost/performance
  • OpenAI: switched default from gpt-4o to gpt-5.4-mini for for improved cost/performance
  • Moonshot / Kimi: replaced kimi-k2-thinking with kimi-k2.5 ahead of K2 deprecation and for lower usage cost
  • Together AI: swapped mistralai/Mixtral-8x7B-Instruct-v0.1 to MiniMaxAI/MiniMax-M2.7, reducing input costs significantly (≈50%) and the previous model is no longer available for serverless usage

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Improvement
  • Model update
  • Other:

Checklist

  • Code complies with style guidelines
  • Ran format/validation scripts (./scripts/format.sh and ./scripts/validate.sh)
  • Self-review completed
  • Documentation updated (comments, docstrings)
  • Examples and guides: Relevant cookbook examples have been included or updated (if applicable)
  • Tested in clean environment
  • Tests added/updated (if applicable)

Duplicate and AI-Generated PR Check

  • I have searched existing open pull requests and confirmed that no other PR already addresses this issue
  • If a similar PR exists, I have explained below why this PR is a better approach
  • Check if this PR was entirely AI-generated (by Copilot, Claude Code, Cursor, etc.)

Additional Notes

It would be valuable to establish a more proactive process for keeping model configurations up to date across providers, especially given the frequency of deprecations and pricing changes.

Additionally, introducing a model recommendation layer could significantly improve user experience. Many users are unsure which model best fits their needs. A simple tiered suggestion system (e.g., low / medium / high capability or cost tiers) could guide users toward better defaults based on their use case.

Happy to contribute to this if aligned with the roadmap.

- Update default model from gemini-3-flash-preview to gemini-flash-latest
- Prepare for deprecation of gemini-2.0-flash-001 on June 1st, 2026
- Verify mimetypes import is present for file operations
- Replace llama-v3p1-405b-instruct with gpt-oss-120b
- The old model is no longer available as serverless on Fireworks
- Use new preferred model for better compatibility
- Replace grok-beta with grok-4-1-fast-non-reasoning-latest
- Use latest production-ready Grok model
- Provides better performance and stability
- Replace gpt-4o with gpt-5.4-mini
- More cost-effective model with better performance
- Recommended as default for new OpenRouter users
- Replace kimi-k2-thinking with kimi-k2.5
- Prepare for deprecation of K2 models on May 25, 2026
- New model offers better pricing (cache hit: $0.10 vs $0.15)
- Maintains same 262k token context window
- Improved performance and stability
- OpenAI: Replace gpt-4o with gpt-5.4-mini for better price-to-performance
- Together: Replace Mixtral-8x7B with MiniMax-M2.7
  - Significantly lower cost: $0.30 input ($0.06 cached) vs $0.60 for Mixtral
  - Better performance and modern architecture
- Both models maintain compatibility while reducing operational costs
@chiruu12 chiruu12 requested a review from a team as a code owner April 25, 2026 15:52
Copilot AI review requested due to automatic review settings April 25, 2026 15:52
@github-actions
Copy link
Copy Markdown
Contributor

PR Triage

A few things to address before this PR can be reviewed:

Missing issue link: Please link the issue this PR addresses using fixes #<issue_number>, closes #<issue_number>, or resolves #<issue_number> in the PR description. If there is no existing issue, please create one first.


Missing tests: This PR modifies source code but does not include any test changes. Please add or update tests to cover your changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates default model identifiers across several provider adapters to move away from soon-to-be-deprecated/unsupported models and align defaults with newer, lower-cost options.

Changes:

  • Updated default id values (and corresponding docstrings) for xAI, Together, OpenRouter, OpenAI Chat, Moonshot, Gemini, and Fireworks model wrappers.
  • Swapped Fireworks and Moonshot defaults to newer model IDs intended to remain available/supportable.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
libs/agno/agno/models/xai/xai.py Update xAI default model id from grok-beta to a newer Grok variant.
libs/agno/agno/models/together/together.py Update Together default model id to MiniMaxAI/MiniMax-M2.7.
libs/agno/agno/models/openrouter/openrouter.py Update OpenRouter default model id from gpt-4o to gpt-5.4-mini.
libs/agno/agno/models/openai/chat.py Update OpenAI Chat default model id from gpt-4o to gpt-5.4-mini.
libs/agno/agno/models/moonshot/moonshot.py Update Moonshot default model id from kimi-k2-thinking to kimi-k2.5.
libs/agno/agno/models/google/gemini.py Update Gemini default model id from gemini-2.0-flash-001 to gemini-flash-latest.
libs/agno/agno/models/fireworks/fireworks.py Update Fireworks default model id to accounts/fireworks/models/gpt-oss-120b.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +41 to 44
id: str = "gpt-5.4-mini"
name: str = "OpenAIChat"
provider: str = "OpenAI"
supports_native_structured_outputs: bool = True
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

OpenAIChat’s default model id is updated here, but there are still other OpenAI defaults hard-coded to "gpt-4o" (e.g., agno/models/defaults.py defines DEFAULT_OPENAI_MODEL_ID = "gpt-4o" and OpenAIResponses defaults to "gpt-4o"). This leaves the codebase with multiple conflicting "default" OpenAI model sources. Consider updating the central default constant/usages (and the Responses default if intended) so defaults are consistent across the library.

Copilot uses AI. Check for mistakes.
Comment on lines 21 to 33
@@ -29,7 +29,7 @@ class OpenRouter(OpenAILike):
these models in order. Example: ["anthropic/claude-sonnet-4", "deepseek/deepseek-r1"]
"""

id: str = "gpt-4o"
id: str = "gpt-5.4-mini"
name: str = "OpenRouter"
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

OpenRouter’s default model id is updated here, but integration tests still pin the old id (e.g., libs/agno/tests/integration/models/openrouter/* uses OpenRouter(id="gpt-4o")). If those tests run in CI or are used as examples, they’ll likely start failing once the model is deprecated/unavailable. Update the OpenRouter integration tests/examples to the new default (or reference OpenRouter().id) to keep the test suite aligned with this migration.

Copilot uses AI. Check for mistakes.
Comment on lines +81 to 83
id: str = "gemini-flash-latest"
name: str = "Gemini"
provider: str = "Google"
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

Gemini’s default model id is updated here, but several integration tests still reference the previous id explicitly (e.g., libs/agno/tests/integration/models/google/* and other integration tests use "gemini-2.0-flash-001"). If the motivation is avoiding upcoming deprecations, those pinned test model IDs should be updated as well to prevent future breakage and to validate the new default in practice.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to 23
id: str = "kimi-k2.5"
name: str = "Moonshot"
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

MoonShot’s default model id is updated, but unit tests still hard-code the old id (libs/agno/tests/unit/models/moonshot/test_moonshot.py uses "kimi-k2-thinking"). Given the stated goal of migrating away from deprecated models, update those tests (and any docs/examples) to a supported model id so the test suite doesn’t keep validating a model slated for deprecation.

Copilot uses AI. Check for mistakes.
Comment on lines +22 to 23
id: str = "accounts/fireworks/models/gpt-oss-120b"
name: str = "Fireworks"
Copy link

Copilot AI Apr 25, 2026

Choose a reason for hiding this comment

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

Fireworks’ default model id is updated here, but integration tests still reference the previous serverless model (e.g., libs/agno/tests/integration/models/fireworks/* uses "accounts/fireworks/models/llama-v3p1-405b-instruct"). If that model is no longer available serverless (per PR description), those tests/examples should be updated to a currently supported Fireworks model to avoid CI breakage and to exercise the new default path.

Copilot uses AI. Check for mistakes.
@chiruu12
Copy link
Copy Markdown
Contributor Author

Fixes #7682 by updating deprecated and legacy models across providers.

- Update DEFAULT_OPENAI_MODEL_ID to gpt-5.4-mini
- Update OpenAIResponses default id to gpt-5.4-mini
- Keep core OpenAI defaults consistent across model entry points
- OpenRouter tests: gpt-4o -> gpt-5.4-mini
- Gemini tests: gemini-2.0-flash-001 -> gemini-flash-latest
- Moonshot tests: kimi-k2-thinking -> kimi-k2.5
- Fireworks tests: llama-v3p1-405b-instruct -> gpt-oss-120b
- Keep tests aligned with updated provider defaults and deprecation plan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants