Back to Promptfoo

Novita Provider

site/docs/providers/novita.md

0.121.132.1 KB
Original Source

Novita

The novita provider routes Promptfoo's OpenAI-compatible provider stack to Novita.

Setup

Set the NOVITA_API_KEY environment variable:

bash
export NOVITA_API_KEY=your_api_key_here

You can also pass apiKey directly in provider configuration when needed.

Provider Formats

text
novita:<model_name>                # chat provider shorthand
novita:chat:<model_name>           # chat completions
novita:completion:<model_name>     # text completions
novita:embedding:<model_name>      # embeddings

The shorthand form defaults to chat mode.

Configuration

yaml
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
providers:
  - id: novita:chat:meta-llama/llama-3.3-70b-instruct
    config:
      temperature: 0.7
      max_tokens: 512

prompts:
  - 'Explain {{topic}} in one paragraph.'

tests:
  - vars:
      topic: retrieval augmented generation

Standard OpenAI-compatible provider options such as temperature, max_tokens, and top_p are forwarded through the shared provider implementation. Promptfoo uses Novita's documented https://api.novita.ai/openai/v1 base URL by default. For an OpenAI-compatible proxy or test server, set apiBaseUrl explicitly:

yaml
providers:
  - id: novita:chat:meta-llama/llama-3.3-70b-instruct
    config:
      apiBaseUrl: https://my-proxy.example.com/openai/v1
      apiKeyEnvar: MY_NOVITA_PROXY_KEY

For the API contract and available models, see Novita's chat completion API, completion API, embeddings API, and list models API.

Example

Initialize the bundled example:

bash
npx promptfoo@latest init --example provider-novita

The example checks a short factual response from a Novita chat model and is a good starting point for local smoke testing.