feat(core): add Fireworks AI as an LLM provider#851
Conversation
Adds Fireworks AI as a supported LLM provider in notte-core, with three model aliases for the Fireworks-hosted models validated in the joint benchmark (Kimi K2.5, GLM-5, MiniMax M2.5). Changes to packages/notte-core/src/notte_core/common/config.py: - LlmProvider.fireworks_ai = "fireworks_ai" - apikey_name case returning "FIREWORKS_API_KEY" - Three LlmModel entries for the benchmark models - Adds fireworks_ai to unsupported_providers in use_strict_response_format (matches the benchmark configuration, which used non-strict json_object) Companion to the docs PR at #846, which uses these model strings in the published Fireworks integration page. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WalkthroughThis PR registers Fireworks AI as LlmProvider.fireworks_ai, maps its apikey_name to FIREWORKS_API_KEY, adds three Fireworks-backed LlmModel entries (fireworks_kimi_k2p5, fireworks_glm_5, fireworks_minimax_m2p5), marks the provider as unsupported for strict response-format enforcement, adds a kimi-k2p5 temperature override, and introduces tests validating provider registration, apikey mapping, provider resolution, non-strict formatting, and the temperature override. Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
| Filename | Overview |
|---|---|
| packages/notte-core/src/notte_core/common/config.py | Adds Fireworks AI provider enum, API key mapping, three model aliases, and use_strict_response_format exclusion. The get_temperature override for kimi-k2p5 is missing — the slug uses p5 instead of .5 so the existing kimi-k2.5 pattern won't match. No tests added. |
Comments Outside Diff (1)
-
packages/notte-core/src/notte_core/common/config.py, line 241-243 (link)The
get_temperatureoverride pattern"kimi-k2.5"won't match the Fireworks model slug"kimi-k2p5"(dots replaced withpfor URL safety). As a result,fireworks_kimi_k2p5will silently use the caller-supplied default temperature instead of1.0, diverging from both the Moonshot-hosted version and the benchmark configuration.Prompt To Fix With AI
This is a comment left during a code review. Path: packages/notte-core/src/notte_core/common/config.py Line: 241-243 Comment: The `get_temperature` override pattern `"kimi-k2.5"` won't match the Fireworks model slug `"kimi-k2p5"` (dots replaced with `p` for URL safety). As a result, `fireworks_kimi_k2p5` will silently use the caller-supplied default temperature instead of `1.0`, diverging from both the Moonshot-hosted version and the benchmark configuration. How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
packages/notte-core/src/notte_core/common/config.py:241-243
The `get_temperature` override pattern `"kimi-k2.5"` won't match the Fireworks model slug `"kimi-k2p5"` (dots replaced with `p` for URL safety). As a result, `fireworks_kimi_k2p5` will silently use the caller-supplied default temperature instead of `1.0`, diverging from both the Moonshot-hosted version and the benchmark configuration.
```suggestion
temperature_overrides: dict[str, float] = {
"kimi-k2.5": 1.0,
"kimi-k2p5": 1.0,
}
```
### Issue 2 of 2
packages/notte-core/src/notte_core/common/config.py:150-152
No unit or integration tests accompany this change. Per the repository's test guidelines, every major feature addition should include at least one integration test — for example, verifying that `LlmModel.get_provider("fireworks_ai/accounts/fireworks/models/kimi-k2p5")` returns `LlmProvider.fireworks_ai`, that `use_strict_response_format` returns `False` for these models, and that `get_temperature` applies the correct override for `fireworks_kimi_k2p5`.
- Add a comment if the PR does n... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
Reviews (1): Last reviewed commit: "feat(core): add Fireworks AI as an LLM p..." | Re-trigger Greptile
| fireworks_kimi_k2p5 = "fireworks_ai/accounts/fireworks/models/kimi-k2p5" | ||
| fireworks_glm_5 = "fireworks_ai/accounts/fireworks/models/glm-5" | ||
| fireworks_minimax_m2p5 = "fireworks_ai/accounts/fireworks/models/minimax-m2p5" |
There was a problem hiding this comment.
No unit or integration tests accompany this change. Per the repository's test guidelines, every major feature addition should include at least one integration test — for example, verifying that
LlmModel.get_provider("fireworks_ai/accounts/fireworks/models/kimi-k2p5") returns LlmProvider.fireworks_ai, that use_strict_response_format returns False for these models, and that get_temperature applies the correct override for fireworks_kimi_k2p5.
Context Used: # Test guidelines
- Add a comment if the PR does n... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/notte-core/src/notte_core/common/config.py
Line: 150-152
Comment:
No unit or integration tests accompany this change. Per the repository's test guidelines, every major feature addition should include at least one integration test — for example, verifying that `LlmModel.get_provider("fireworks_ai/accounts/fireworks/models/kimi-k2p5")` returns `LlmProvider.fireworks_ai`, that `use_strict_response_format` returns `False` for these models, and that `get_temperature` applies the correct override for `fireworks_kimi_k2p5`.
**Context Used:** # Test guidelines
- Add a comment if the PR does n... ([source](https://app.greptile.com/review/custom-context?memory=instruction-0))
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Two fixes:
1. Add "kimi-k2p5" to the get_temperature override dict so the
Fireworks-hosted Kimi K2.5 picks up the same 1.0 temperature as
the Moonshot-hosted version. The original entry only matched the
"kimi-k2.5" slug (with dot), not the URL-safe "kimi-k2p5" slug
that Fireworks uses.
2. Add tests/config/test_fireworks_provider.py covering:
- LlmProvider.fireworks_ai registration and apikey_name
- LlmModel.get_provider resolution for the new aliases
- use_strict_response_format returns False for Fireworks models
- get_temperature override applies to fireworks_kimi_k2p5 with
parity to kimi2_5 (validates the fix above)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@tests/config/test_fireworks_provider.py`:
- Line 1: Reformat the import statement so Ruff/isort accepts it: replace the
single-line "from notte_core.common.config import LlmModel, LlmProvider" with a
properly sorted and wrapped import (alphabetical order) using parentheses or
one-per-line style, e.g. "from notte_core.common.config import (LlmModel,
LlmProvider)" or separate lines, ensuring LlmModel and LlmProvider are
alphabetized; this will satisfy Ruff I001.
- Around line 16-17: The test contains a raw secret-like string literal causing
detect-secrets to fail; update the test_test_fireworks_provider_apikey_name
(function test_fireworks_provider_apikey_name) to either replace the hardcoded
literal with a constructed value (e.g., join or format the parts) or add an
explicit detect-secrets allowlist pragma for that assertion, ensuring the
assertion still verifies LlmProvider.fireworks_ai.apikey_name equals
"FIREWORKS_API_KEY" but does not present a raw secret token to the scanner.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: e0fa6ce8-bd4b-4267-9561-f119bbc3d5cf
📒 Files selected for processing (2)
packages/notte-core/src/notte_core/common/config.pytests/config/test_fireworks_provider.py
| @@ -0,0 +1,38 @@ | |||
| from notte_core.common.config import LlmModel, LlmProvider | |||
There was a problem hiding this comment.
Fix import block formatting to unblock Ruff.
CI is failing on Ruff I001 at Line 1; please apply Ruff/isort formatting for this import block.
🧰 Tools
🪛 GitHub Actions: pytest cicd / 0_tests.txt
[error] 1-1: ruff check (hook id: ruff-check) failed: I001 Import block is un-sorted or un-formatted. Organize imports. (1 error; fixable with --fix)
🪛 GitHub Actions: pytest cicd / tests
[error] 1-1: Ruff (ruff-check) failed: I001 Import block is un-sorted or un-formatted. Organize imports. Hook id: ruff-check, exit code: 1.
🤖 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 `@tests/config/test_fireworks_provider.py` at line 1, Reformat the import
statement so Ruff/isort accepts it: replace the single-line "from
notte_core.common.config import LlmModel, LlmProvider" with a properly sorted
and wrapped import (alphabetical order) using parentheses or one-per-line style,
e.g. "from notte_core.common.config import (LlmModel, LlmProvider)" or separate
lines, ensuring LlmModel and LlmProvider are alphabetized; this will satisfy
Ruff I001.
Source: Pipeline failures
| def test_fireworks_provider_apikey_name(): | ||
| assert LlmProvider.fireworks_ai.apikey_name == "FIREWORKS_API_KEY" |
There was a problem hiding this comment.
Resolve detect-secrets failure on the API key literal.
CI flags this test at Line 16 as a secret-keyword hit. Add an explicit allowlist pragma for this intentional test literal (or rewrite the assertion to avoid a raw secret-like token) so pre-commit passes.
Suggested minimal fix
def test_fireworks_provider_apikey_name():
- assert LlmProvider.fireworks_ai.apikey_name == "FIREWORKS_API_KEY"
+ assert LlmProvider.fireworks_ai.apikey_name == "FIREWORKS_API_KEY" # pragma: allowlist secret🧰 Tools
🪛 GitHub Actions: pytest cicd / 0_tests.txt
[error] 16-16: detect-secrets (hook id: detect-secrets) failed: Potential secrets about to be committed to git repo. Secret Type: Secret Keyword. Location: tests/config/test_fireworks_provider.py:16
🪛 GitHub Actions: pytest cicd / tests
[error] 16-16: detect-secrets failed (exit code: 1): Potential secrets about to be committed to git repo. Secret Type: Secret Keyword. Location: tests/config/test_fireworks_provider.py:16.
🤖 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 `@tests/config/test_fireworks_provider.py` around lines 16 - 17, The test
contains a raw secret-like string literal causing detect-secrets to fail; update
the test_test_fireworks_provider_apikey_name (function
test_fireworks_provider_apikey_name) to either replace the hardcoded literal
with a constructed value (e.g., join or format the parts) or add an explicit
detect-secrets allowlist pragma for that assertion, ensuring the assertion still
verifies LlmProvider.fireworks_ai.apikey_name equals "FIREWORKS_API_KEY" but
does not present a raw secret token to the scanner.
Source: Pipeline failures
Summary
Adds Fireworks AI as a supported LLM provider in
notte-core, with threeLlmModelaliases for the Fireworks-hosted models validated in the joint Notte × Fireworks benchmark (Kimi K2.5, GLM-5, MiniMax M2.5).Why
Companion to the Fireworks docs PR at #846, which documents the integration and uses
reasoning_modelstrings of the formfireworks_ai/accounts/fireworks/models/<slug>. Without this change, the cloud rejects those strings at/agents/startwith a 422 because theLlmProviderenum has nofireworks_aientry, soLlmModel.get_provider()raises and the validator returns "not supported."Empirically confirmed by running
agent.run()against the cloud withreasoning_model="fireworks_ai/accounts/fireworks/models/kimi-k2p5":Cloud validation reads its allowlist via
LlmModel.valid()in this same file, so this single SDK change unlocks the docs example once the package is deployed andFIREWORKS_API_KEYis set in the cloud's environment.Diff
packages/notte-core/src/notte_core/common/config.py:LlmProvider.fireworks_ai = "fireworks_ai"apikey_namematch arm returning"FIREWORKS_API_KEY"LlmModelaliases:fireworks_kimi_k2p5 = "fireworks_ai/accounts/fireworks/models/kimi-k2p5"fireworks_glm_5 = "fireworks_ai/accounts/fireworks/models/glm-5"fireworks_minimax_m2p5 = "fireworks_ai/accounts/fireworks/models/minimax-m2p5"fireworks_aitounsupported_providersinuse_strict_response_format, matching the benchmark configuration (which used non-strictjson_object)Cloud requirement
After merge + redeploy, the cloud needs
FIREWORKS_API_KEYset in its production environment for these models to appear inLlmModel.valid(). Without that env var,has_apikey_in_env()filters them out.Naming
The model aliases (
fireworks_kimi_k2p5,fireworks_glm_5,fireworks_minimax_m2p5) follow the convention of prefixing with the provider to avoid collision with the existingkimi2_5(Moonshot direct) andminimax(MiniMax direct) entries. Happy to rename to any preferred convention.Test plan
FIREWORKS_API_KEYset,agent.run(reasoning_model="fireworks_ai/accounts/fireworks/models/kimi-k2p5")succeeds against the cloud🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Behavior Changes
Tests