Skip to content

[upstream-sync] Add Novita AI as LLM provider (upstream PR #1781) #134

@github-actions

Description

@github-actions

Upstream Change Summary

Type: new-feature
Difficulty: Easy
Recommendation: Adopt

Upstream PR #1781 adds Novita AI as a new LLM provider using the OpenAI-compatible API at https://api.novita.ai/openai/v1. The implementation follows the same pattern as other OpenAI-compatible providers (LiteLLM, vLLM) and supports both text generation and embeddings. Authentication is via NOVITA_API_KEY environment variable or constructor parameter.

This change adds a new variant to the LlmApiType enum in Rust and a corresponding novita.rs client module wired into the generation and embedding client factories.

Upstream References

Relevant Upstream Files / Areas

  • rust/cocoindex/src/llm/mod.rscrates/recoco/src/llm/mod.rs (LlmApiType enum, factory wiring)
  • rust/cocoindex/src/llm/novita.rscrates/recoco/src/llm/novita.rs (new client module)

Recoco Considerations

  • Affected modules: crates/recoco LLM module (used by function-embed and function-extract-llm)
  • Feature-gating: Should be gated behind the same feature flag as other OpenAI-compatible providers (e.g., function-embed or a new llm-novita gate if desired for fine-grained control)
  • API surface: LlmApiType enum gains a Novita variant — this is a non-breaking additive change to recoco's public API
  • No Python to exclude: The upstream change is entirely in rust/cocoindex/src/llm/
  • Environment variable: NOVITA_API_KEY follows established *_API_KEY pattern already used by other providers

Integration Notes

Pattern is identical to LiteLLM/vLLM adapters. Once the novita.rs module is created with the correct base URL (https://api.novita.ai/openai/v1), the main work is:

  1. Adding Novita to LlmApiType
  2. Wiring it into generation_client_factory and embedding_client_factory in llm/mod.rs
  3. Adding appropriate feature gate and dependency (reqwest or existing HTTP client)

Metadata

Metadata

Assignees

No one assigned

    Labels

    claudeCreated or actioned by Claude AIupstream-syncIssues for syncing updates with our upstream (cocoindex-io/cocoindex)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions