Skip to content

feat: add Novita AI as LLM provider#1847

Open
Alex-wuhu wants to merge 1 commit intounclecode:mainfrom
Alex-wuhu:novita-integration
Open

feat: add Novita AI as LLM provider#1847
Alex-wuhu wants to merge 1 commit intounclecode:mainfrom
Alex-wuhu:novita-integration

Conversation

@Alex-wuhu
Copy link

Summary

  • Registers Novita AI models in PROVIDER_MODELS and PROVIDER_MODELS_PREFIXES (crawl4ai/config.py) so NOVITA_API_KEY is auto-resolved for any novita/… provider string
  • Documents NOVITA_API_KEY and NOVITA_BASE_URL in the Docker deployment README

Usage

Novita AI exposes an OpenAI-compatible endpoint. Use it with LLMConfig:

from crawl4ai import LLMConfig

llm_config = LLMConfig(
    provider="novita/moonshotai/kimi-k2.5",
    api_token="env:NOVITA_API_KEY",   # or set NOVITA_API_KEY in environment
    base_url="https://api.novita.ai/openai",
)

Supported models:

Model Context Notes
novita/moonshotai/kimi-k2.5 262k Recommended default
novita/zai-org/glm-5 202k
novita/minimax/minimax-m2.5 204k

For Docker deployments, pass the following environment variables:

NOVITA_API_KEY=your-novita-key
NOVITA_BASE_URL=https://api.novita.ai/openai

The existing get_llm_base_url() utility already picks up NOVITA_BASE_URL via the generic {PROVIDER_NAME}_BASE_URL pattern — no Docker-layer changes were needed.

How it works

crawl4ai routes all LLM calls through litellm. For OpenAI-compatible providers, litellm accepts any model string with an explicit api_base. The PROVIDER_MODELS_PREFIXES entry ensures the API key is resolved automatically from NOVITA_API_KEY whenever a novita/… provider string is used, matching the pattern of existing providers (deepseek, groq, etc.).

Register Novita AI models in PROVIDER_MODELS and PROVIDER_MODELS_PREFIXES
so that NOVITA_API_KEY is auto-resolved when the novita/ prefix is used.
Novita AI exposes an OpenAI-compatible endpoint; callers should set
base_url="https://api.novita.ai/openai" in LLMConfig.

Supported models:
- novita/moonshotai/kimi-k2.5  (default, 262k context)
- novita/zai-org/glm-5
- novita/minimax/minimax-m2.5

Also document NOVITA_API_KEY and NOVITA_BASE_URL in the Docker README.
@Alex-wuhu Alex-wuhu marked this pull request as ready for review March 22, 2026 12:40
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.

1 participant