Skip to content

feat(providers): add Pareto Inference as OpenAI-compatible provider - #42789

Open
dylanduyvu wants to merge 1 commit into
BerriAI:mainfrom
dylanduyvu:feat/add-pareto-provider
Open

dylanduyvu wants to merge 1 commit into
BerriAI:mainfrom
dylanduyvu:feat/add-pareto-provider

Conversation

@dylanduyvu

Copy link
Copy Markdown

TLDR

Problem this solves:

  • Pareto Inference serves GLM 5.3 Flash on an OpenAI-compatible API
  • Users must configure it as a generic openai/ model with a custom base

How it solves it:

  • Registers pareto in the JSON provider registry
  • pareto/z-ai/glm-5.3-flash routes to https://api.paretoinference.com/v1
  • Reads PARETO_API_KEY, with optional PARETO_API_BASE override
  • Adds per-token pricing so spend tracking works

User Flow

Before: a developer who wants GLM 5.3 Flash from Pareto has no named provider

  1. They call litellm.completion(model="pareto/z-ai/glm-5.3-flash", ...) with PARETO_API_KEY set
  2. LiteLLM raises BadRequestError: LLM Provider NOT provided
  3. Workaround: model="openai/z-ai/glm-5.3-flash" plus a manual api_base and api_key

After: the same call works and is priced

  1. They call litellm.completion(model="pareto/z-ai/glm-5.3-flash", ...) with PARETO_API_KEY set
  2. The request goes to POST https://api.paretoinference.com/v1/chat/completions with Authorization: Bearer <key>
  3. The response returns with usage, and the logged spend uses $0.03 input, $0.10 output and $0.006 cached input per 1M tokens

Relevant issues

Affected release

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • The handful of test files covering my change pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Setup: export PARETO_API_KEY=<key from https://paretoinference.com> and export LITELLM_LOCAL_MODEL_COST_MAP=True (the remote cost map has no Pareto entry until this merges). Real calls to the live Pareto API, no mocks.

Before (1c289e5)

  1. python -c "import litellm; litellm.completion(model='pareto/z-ai/glm-5.3-flash', messages=[{'role':'user','content':'Say hi'}])"
  2. BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=pareto/z-ai/glm-5.3-flash

After (c8bc6a1)

Non-streaming

  1. r = litellm.completion(model="pareto/z-ai/glm-5.3-flash", messages=[{"role": "user", "content": "Say hi"}], max_tokens=512)
  2. r.choices[0].message.content = 'Hi there! 👋 How can I help you today?', r.model = pareto/z-ai/glm-5.3-flash
  3. r.usage: prompt_tokens=14, completion_tokens=44, total_tokens=58
  4. litellm.completion_cost(completion_response=r) = 0.0000048200 USD (14 × $0.03/1M + 44 × $0.10/1M)

Streaming with usage

  1. litellm.completion(..., max_tokens=512, stream=True, stream_options={"include_usage": True})
  2. 47 chunks, text "Hi there! It's nice to meet you. How can I help you today?"
  3. Final chunk usage: prompt_tokens=14, completion_tokens=46, total_tokens=60

Type

🆕 New Feature

Caveats (if any)

Low

  • Chat completions only; the registry entry declares no other endpoints
  • The docs link in the provider matrix needs a companion docs PR in BerriAI/litellm-docs
  • No dashboard logo or provider-list entry; the Add Model field definitions are included

Registers pareto through the JSON provider registry, so pareto/z-ai/glm-5.3-flash
resolves to https://api.paretoinference.com/v1 with PARETO_API_KEY and an optional
PARETO_API_BASE override. Adds LlmProviders.PARETO, the constants.py provider and
endpoint lists so an api_base pointing at Pareto also resolves to the provider, the
provider endpoints matrix, the Add Model provider fields, per-token pricing for
pareto/z-ai/glm-5.3-flash in both cost maps, and tests.
@CLAassistant

CLAassistant commented Sep 23, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Sep 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@greptile-apps

greptile-apps Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR appears safe to merge, with a non-blocking routing issue where unsupported Pareto transcription calls are sent upstream instead of rejected locally.

Findings

  1. P2 Chat Provider Enables Transcription ▶

Summary

This PR adds Pareto Inference as a declaratively configured OpenAI-compatible provider:

  • Registers the pareto provider, default API base, and environment-based credentials.
  • Adds GLM 5.3 Flash token pricing and cached-input pricing to both cost maps.
  • Declares chat-only endpoint support and adds proxy provider-creation metadata.
  • Adds mocked tests for provider resolution, authentication, request transport, and pricing.
  • The broad compatibility registration also opts Pareto into the shared audio-transcription transport despite its chat-only capability declaration.

Reviews (1) · Last reviewed commit: "feat(providers): add Pareto Inference as..."

Comment thread litellm/constants.py
"meta", # Meta Model API (Muse Spark) - JSON-configured provider
"cognition",
"scx-ai",
"pareto",

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.

P2 Chat Provider Enables Transcription

Adding Pareto to openai_compatible_providers also adds it to OPENAI_AUDIO_TRANSCRIPTION_PROVIDERS. As a result, transcription(model="pareto/...") selects the OpenAI transcription transport and sends a request to Pareto's /audio/transcriptions endpoint, even though the new capability map declares audio transcription unsupported. This should be gated by the declared capability or otherwise excluded so unsupported calls are rejected locally instead of being sent upstream.

Knowledge Base Used: Provider adapters and capabilities

@codspeed

codspeed Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing dylanduyvu:feat/add-pareto-provider (c8bc6a1) with main (e0af991)

Open in CodSpeed

This branch has not been deployed

No deployments
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.

2 participants