Skip to content

fix(groq): honor model kwarg in generate_with_usage response metadata#207

Open
syf2211 wants to merge 1 commit into
OpenAgentHQ:mainfrom
syf2211:fix/groq-response-model-kwarg-79
Open

fix(groq): honor model kwarg in generate_with_usage response metadata#207
syf2211 wants to merge 1 commit into
OpenAgentHQ:mainfrom
syf2211:fix/groq-response-model-kwarg-79

Conversation

@syf2211

@syf2211 syf2211 commented Jul 22, 2026

Copy link
Copy Markdown

Description

Groq.generate_with_usage() already sent the per-request model override in the API payload but always reported self.model in the returned LLMResponse. This fix uses the resolved request model so response metadata matches the model actually used.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Test update
  • CI/CD update

Related Issues

Closes #79

How Has This Been Tested?

  • Unit tests pass (pytest tests/unit/test_providers/test_groq.py -v — 18 passed)
  • Linter passes on changed files (ruff check on groq.py and test_groq.py)
  • Type checker passes (uv run mypy openagent_eval/)
  • Manual testing performed

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

One-line behavioral fix in groq.py; follows the model-override testing pattern from test_ollama.py.

Fixes OpenAgentHQ#79

generate_with_usage() already sent the per-request model override in the
API payload but LLMResponse.model always used self.model. Use the resolved
request model so evaluation pipelines and cost trackers attribute responses
correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

providers(groq): generate_with_usage response.model ignores model kwarg override

1 participant