Skip to content

feat: add Novita AI as a bundled LLM provider#49749

Closed
Alex-wuhu wants to merge 0 commit intoopenclaw:mainfrom
Alex-wuhu:main
Closed

feat: add Novita AI as a bundled LLM provider#49749
Alex-wuhu wants to merge 0 commit intoopenclaw:mainfrom
Alex-wuhu:main

Conversation

@Alex-wuhu
Copy link
Copy Markdown

@Alex-wuhu Alex-wuhu commented Mar 18, 2026

Summary

  • Add Novita AI as a new bundled provider plugin with OpenAI-compatible API (openai-completions)
  • Endpoint: https://api.novita.ai/openai, auth via NOVITA_API_KEY
  • Ships 3 models: Kimi K2.5 (default), GLM 5, MiniMax M2.5

Test plan

  • pnpm build passes
  • NOVITA_API_KEY=<key> openclaw resolves novita/moonshotai/kimi-k2.5 and can send a request
  • Onboard wizard shows Novita AI as a provider option

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: M labels Mar 18, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR adds Novita AI as a new bundled LLM provider, following the exact same patterns established by the together provider extension (shared model catalog in src/agents/, plugin entry in extensions/novita/, and onboarding helpers). The overall integration is clean and consistent with the existing codebase.

  • New extensions/novita/ plugin with index.ts, onboard.ts, provider-catalog.ts, and openclaw.plugin.json — all structurally correct and mirrors the together provider.
  • src/agents/novita-models.ts defines 3 models (Kimi K2.5, GLM 5, MiniMax M2.5) with pricing and capability metadata, re-exported via the plugin SDK.
  • novita is correctly added to BUNDLED_ENABLED_BY_DEFAULT and the bundled auth env-var manifest.
  • One concern: maxTokens: 262144 for Kimi K2.5 is identical to the full contextWindow, which is atypical. The Together AI provider for the same model uses maxTokens: 32768. If Novita enforces a lower output token ceiling (which is very common), this could trigger API errors at runtime.

Confidence Score: 4/5

  • PR is safe to merge with one caveat worth verifying: the maxTokens value for Kimi K2.5 should be confirmed against Novita's API limits.
  • The integration follows established patterns exactly and all wiring (manifest, config-state, SDK exports, onboarding) is correct. The only issue is that maxTokens: 262144 for Kimi K2.5 equals the full context window — this is almost certainly wrong based on how peer providers configure the same model, and could cause runtime API errors if Novita enforces a lower output token limit.
  • src/agents/novita-models.ts — verify maxTokens values for all three models against Novita's official API documentation.
Prompt To Fix All 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.

Last reviewed commit: "feat: add Novita AI ..."

Comment thread src/agents/novita-models.ts Outdated
name: "Kimi K2.5",
reasoning: true,
input: ["text", "image"],
contextWindow: 262144,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 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.

Suggested change
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.

Copy link
Copy Markdown

@Chenglin97 Chenglin97 left a comment

Choose a reason for hiding this comment

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

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.

@Alex-wuhu
Copy link
Copy Markdown
Author

Re: greptile bot's concern about maxTokens: 262144 for Kimi K2.5 —

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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 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".

Comment thread extensions/novita/index.ts Outdated
@openclaw-barnacle openclaw-barnacle bot added the docs Improvements or additions to documentation label Mar 18, 2026
@Alex-wuhu Alex-wuhu requested a review from Chenglin97 March 18, 2026 11:37
@Alex-wuhu Alex-wuhu closed this Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants