feat: add Novita AI as a bundled LLM provider#49749
feat: add Novita AI as a bundled LLM provider#49749Alex-wuhu wants to merge 0 commit intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR adds Novita AI as a new bundled LLM provider, following the exact same patterns established by the
Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: src/agents/novita-models.ts
Line: 11
Comment:
**`maxTokens` equals full context window**
`maxTokens` for Kimi K2.5 is set to `262144`, which is identical to the `contextWindow`. This means the model is expected to be able to output the entire context window worth of tokens — which is almost never the case. For comparison, the Together AI provider configuration for the same `moonshotai/Kimi-K2.5` model caps `maxTokens` at `32768`.
If Novita's API enforces a lower output token limit (e.g. 32K or 16K), requests that rely on this value to bound their output could fail at runtime with an API error.
```suggestion
maxTokens: 32768,
```
Please confirm the actual max output tokens limit from Novita's API documentation before merging.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: "feat: add Novita AI ..." |
| name: "Kimi K2.5", | ||
| reasoning: true, | ||
| input: ["text", "image"], | ||
| contextWindow: 262144, |
There was a problem hiding this comment.
maxTokens equals full context window
maxTokens for Kimi K2.5 is set to 262144, which is identical to the contextWindow. This means the model is expected to be able to output the entire context window worth of tokens — which is almost never the case. For comparison, the Together AI provider configuration for the same moonshotai/Kimi-K2.5 model caps maxTokens at 32768.
If Novita's API enforces a lower output token limit (e.g. 32K or 16K), requests that rely on this value to bound their output could fail at runtime with an API error.
| contextWindow: 262144, | |
| maxTokens: 32768, |
Please confirm the actual max output tokens limit from Novita's API documentation before merging.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/novita-models.ts
Line: 11
Comment:
**`maxTokens` equals full context window**
`maxTokens` for Kimi K2.5 is set to `262144`, which is identical to the `contextWindow`. This means the model is expected to be able to output the entire context window worth of tokens — which is almost never the case. For comparison, the Together AI provider configuration for the same `moonshotai/Kimi-K2.5` model caps `maxTokens` at `32768`.
If Novita's API enforces a lower output token limit (e.g. 32K or 16K), requests that rely on this value to bound their output could fail at runtime with an API error.
```suggestion
maxTokens: 32768,
```
Please confirm the actual max output tokens limit from Novita's API documentation before merging.
How can I resolve this? If you propose a fix, please make it concise.
Chenglin97
left a comment
There was a problem hiding this comment.
Review: feat: add Novita AI as a bundled LLM provider
The integration follows the established pattern (definePluginEntry, buildSingleProviderApiKeyCatalog, plugin manifest, env var registration) and the code is structurally consistent with other bundled providers like Moonshot and ModelStudio. A few things worth addressing:
contextWindow equals maxTokens for Kimi K2.5
contextWindow: 262144,
maxTokens: 262144,maxTokens is the per-response output limit, not the context window size. Having them identical (256K) looks wrong — 256K output tokens per request would be an unusually large output budget, and it is likely the Novita API enforces a much smaller output limit. Other models in the codebase (e.g., Anthropic claude-sonnet-4: 200K context / 64K max output) have clearly different values. Please verify these against Novita's API docs. An overestimated maxTokens could cause the agent to pass an max_tokens parameter the API rejects, or to skip truncation it should do.
Prompt caching cost fields for Novita
All three models include cacheRead and cacheWrite costs. Does Novita's OpenAI-compatible endpoint actually support prompt caching? If not, these fields are misleading and could cause the runtime to expect caching behavior that won't occur. Worth checking whether other OpenAI-compatible providers that don't support caching (e.g., NVIDIA, Together) leave these fields out.
novita in BUNDLED_ENABLED_BY_DEFAULT
Adding Novita to BUNDLED_ENABLED_BY_DEFAULT means it is enabled for every openclaw installation. Unlike widely-known providers (OpenAI, Anthropic), Novita is a newer inference marketplace. Is this the right tier? Some providers (like nvidia, modelstudio) are enabled-by-default, others are not. If Novita's service quality is still being established, making it opt-in (not in the default set) reduces user confusion if the API has reliability issues.
buildNovitaModelDefinition type signature
export function buildNovitaModelDefinition(
model: (typeof NOVITA_MODEL_CATALOG)[number],
): ModelDefinitionConfig {NOVITA_MODEL_CATALOG is typed as ModelDefinitionConfig[], so (typeof NOVITA_MODEL_CATALOG)[number] resolves to ModelDefinitionConfig — the parameter type is not narrower than ModelDefinitionConfig itself. The function could accept any model config, not just Novita catalog entries. This is not a bug, but the type is doing less work than intended. Consider using a typed catalog (e.g., as const satisfies ModelDefinitionConfig[]) if narrowness is important.
No tests
The PR test plan is manual-only. For a new provider, at minimum a discovery.contract.test.ts fixture and a provider catalog test (like models-config.providers.minimax.test.ts does for MiniMax) would prevent catalog regression. Without automated coverage, a future refactor of buildSingleProviderApiKeyCatalog could silently break Novita without any failing tests.
Minor: onboard.ts exports both applyNovitaProviderConfig and applyNovitaConfig but index.ts only uses applyNovitaConfig. The exported applyNovitaProviderConfig is useful for testing, but a comment noting the distinction (one sets the primary model, one doesn't) would help.
|
Re: greptile bot's concern about Confirmed from Novita's official model page: Max Output is 262,144 tokens, matching the context window. This is the correct value for Novita's API. Together's 32768 cap is a Together-specific limit, not applicable here. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f1ff244415
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Summary
openai-completions)https://api.novita.ai/openai, auth viaNOVITA_API_KEYTest plan
pnpm buildpassesNOVITA_API_KEY=<key> openclawresolvesnovita/moonshotai/kimi-k2.5and can send a request