Skip to content

feat(openinfer): add OpenInfer as an OpenAI-compatible provider#34623

Open
AJ-ing wants to merge 1 commit into
BerriAI:mainfrom
AJ-ing:feat/openinfer-provider
Open

feat(openinfer): add OpenInfer as an OpenAI-compatible provider#34623
AJ-ing wants to merge 1 commit into
BerriAI:mainfrom
AJ-ing:feat/openinfer-provider

Conversation

@AJ-ing

@AJ-ing AJ-ing commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • Adds OpenInfer (openinfer) as a JSON-configured OpenAI-compatible provider
  • API base: https://api.openinfer.ai/v1 (overridable via OPENINFER_API_BASE)
  • API key: OPENINFER_API_KEY
  • Supports /v1/chat/completions (as requested in [Feature]:Add OpenInfer Provider #34357)

Motivation

OpenInfer asked for a native LiteLLM provider in #34357 so users don't need the generic OpenAI-compatible path. This follows the same pattern as other JSON providers (e.g. Pinstripes).

Test plan

  • Added tests/test_litellm/llms/openai_like/test_openinfer_provider.py
  • pytest tests/test_litellm/llms/openai_like/test_openinfer_provider.py
  • Manual: litellm.completion(model="openinfer/<model>", api_key=...) when a key is available

Closes #34357

Made with Cursor

Register OpenInfer via the JSON provider registry so users can call
`openinfer/<model>` with OPENINFER_API_KEY. Adds enum/constants routing,
URL autodetection, endpoint matrix entry, a placeholder model price row,
and unit tests.

Fixes BerriAI#34357

Co-authored-by: Cursor <cursoragent@cursor.com>
@CLAassistant

CLAassistant commented Jul 25, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@greptile-apps

greptile-apps Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds OpenInfer as a JSON-configured OpenAI-compatible chat provider.

  • Registers provider discovery, API endpoint, environment-based credentials, and shared OpenAI handler routing.
  • Adds model pricing/context metadata and endpoint-support metadata.
  • Adds unit coverage for registration, configuration, environment overrides, URL detection, and chat-completion URL construction.

Confidence Score: 5/5

The PR appears safe to merge with no concrete blocking or independently actionable issues identified.

OpenInfer is consistently registered across provider resolution, shared OpenAI-compatible dispatch, endpoint metadata, model metadata, and focused configuration tests.

Important Files Changed

Filename Overview
litellm/llms/openai_like/providers.json Registers OpenInfer with the shared OpenAI GPT configuration and chat-completions endpoint.
litellm/litellm_core_utils/get_llm_provider_logic.py Adds default OpenInfer endpoint detection and environment-key resolution consistent with neighboring JSON providers.
litellm/types/utils.py Adds the OpenInfer provider enum needed for provider lookup and dispatch.
model_prices_and_context_window.json Adds OpenInfer model context, capability, and zero-cost metadata without an established changed-code defect.
tests/test_litellm/llms/openai_like/test_openinfer_provider.py Covers provider registration, JSON configuration, prefixed routing, environment overrides, endpoint detection, and URL generation.

Reviews (1): Last reviewed commit: "feat(openinfer): add OpenInfer as OpenAI..." | Re-trigger Greptile

@codecov

codecov Bot commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing AJ-ing:feat/openinfer-provider (e644ed3) with main (0cd588a)

Open in CodSpeed

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