Skip to content

Add Novita as a third LLM provider for generate() - #19

Open
jax-novita wants to merge 3 commits into
GGChamp85:mainfrom
jax-novita:add-novita-provider
Open

Add Novita as a third LLM provider for generate()#19
jax-novita wants to merge 3 commits into
GGChamp85:mainfrom
jax-novita:add-novita-provider

Conversation

@jax-novita

Copy link
Copy Markdown

Summary

  • Adds provider="novita" to generate(), calling Novita AI's OpenAI-compatible Chat Completions API (same request shape as _call_openai, only base_url and the default API key env var differ)
  • Defaults to moonshotai/kimi-k3 when no model is passed; reads NOVITA_API_KEY when no api_key is passed
  • Updates the provider type hint, docstring, and error message; updates the README example to mention the new option

Test Plan

  • All existing tests pass (pytest)
  • New tests added for new functionality
  • Linting clean (ruff check src/ tests/, ruff format --check)
  • Verified against the live Novita API (model catalog + a real chat completion) with a valid NOVITA_API_KEY

Novita AI exposes an OpenAI-compatible Chat Completions API, so the
implementation follows the same shape as _call_openai: same request
kwargs, same structured-output response_format handling, only the
client's base_url and default API key env var differ.
The models listed for Novita were older ids that no longer reflect what
the platform leads with. Point the recommendations at the three current
flagships instead, each verified against api.novita.ai:

  moonshotai/kimi-k3              1M context, native vision
  zai-org/glm-5.2                 1M context, long-horizon agentic work
  deepseek/deepseek-v4-flash-0731 1M context, cheapest of the three

Context windows, output limits, input modalities and pricing were taken
from the live /openai/v1/models response rather than carried over.
QA flagged tests/test_llm_pipeline.py:246 as failing `ruff format --check`.
@jax-novita
jax-novita requested a review from GGChamp85 as a code owner August 10, 2026 23:48
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