Skip to content

feat(providers): add Prism provider - #40914

Open
rajitkhanna wants to merge 17 commits into
BerriAI:mainfrom
prismhq:feat-prism-provider
Open

rajitkhanna wants to merge 17 commits into
BerriAI:mainfrom
prismhq:feat-prism-provider

Conversation

@rajitkhanna

@rajitkhanna rajitkhanna commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

TLDR

Problem this solves:

  • Prism requires manual provider configuration
  • Prism model pricing and endpoints are not advertised

How it solves it:

  • Registers Prism as a native provider
  • Adds DeepSeek V4 and V4.1 Flash metadata
  • Enables Chat Completions, Responses, and Messages routing

User Flow

Before: a developer cannot route Prism requests through LiteLLM

  1. They set PRISM_API_KEY and configure prism/deepseek-v4.1-flash
  2. They call Chat Completions, Responses, or Messages through LiteLLM
  3. LiteLLM rejects the provider or cannot resolve the endpoint

After: the same requests route to Prism with correct model pricing

  1. They set PRISM_API_KEY and configure prism/deepseek-v4.1-flash
  2. They call Chat Completions, Responses, or Messages through LiteLLM
  3. LiteLLM calls the matching endpoint at https://api.prisminference.com/v1

Relevant issues

Linear ticket

Pre-Submission checklist

  • I have added meaningful tests
  • The focused provider, endpoint, and schema tests pass locally
  • My PR passes all required CI/CD checks
  • My PR's scope is as isolated as possible
  • I have received a Greptile Confidence Score of at least 4/5

Screenshots / Proof of Fix

Live proof is pending deployment verification

Type

New Feature

Caveats (if any)

Low

  • Full local checks require Node 24.14.1 or newer

Final Attestation

  • Tests cover provider routing, credentials, pricing, and functional Responses and Messages requests

@codspeed

codspeed Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing prismhq:feat-prism-provider (7f93254) with litellm_internal_staging (af6dc1d)

Open in CodSpeed

@codecov

codecov Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@yuneng-berri
yuneng-berri deleted the branch BerriAI:main September 13, 2026 04:53
@yuneng-berri yuneng-berri reopened this Sep 13, 2026
…ow read fails

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
ryan-crabbe-berri and others added 2 commits September 14, 2026 15:03
…iption

feat(model_hub): surface model_info.description in Model Hub
…ip_save_on_failed_read

fix(health): skip background health check DB writes when the latest-row read fails
@rajitkhanna
rajitkhanna marked this pull request as ready for review September 15, 2026 18:49
@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR registers Prism as a declarative OpenAI-compatible provider, adds two model catalog entries, and exposes Prism through provider and endpoint metadata

  • Adds default Prism endpoint and credential resolution
  • Enables Chat Completions, Responses, and Anthropic Messages adapter selection
  • Adds pricing, limits, caching, reasoning, tools, and structured-output capabilities for two DeepSeek models
  • Adds configuration-level tests, but does not functionally exercise the new Responses or Messages request paths

Confidence Score: 4/5

The provider registration appears correct, but the repository’s required functional-test standard must be satisfied before merging

No concrete runtime defect was established, but the tests only resolve the new Responses and Messages configurations instead of exercising their request behavior

Files Needing Attention: tests/test_litellm/llms/openai_like/test_prism_provider.py

Important Files Changed

Filename Overview
litellm/llms/openai_like/providers.json Adds a consistent declarative Prism configuration for credentials, base URL, and three supported endpoint families
litellm/constants.py Registers Prism’s provider slug and API base with the OpenAI-compatible routing lists
litellm/types/utils.py Adds the Prism provider enum needed by typed provider configuration lookup
model_prices_and_context_window.json Adds schema-compatible pricing, limits, endpoints, and capability metadata for two Prism models
provider_endpoints_support.json Advertises Prism support for Chat Completions, Responses, and Messages consistently with the declarative provider definition
litellm/proxy/public_endpoints/provider_create_fields.json Adds Prism API key and optional API base fields to the provider creation metadata
tests/test_litellm/llms/openai_like/test_prism_provider.py Covers registration, credentials, costs, metadata, and configuration lookup, but lacks functional Responses and Messages request coverage

Reviews (1): Last reviewed commit: "feat(providers): add DeepSeek V4.1 Flash..." | Re-trigger Greptile

Comment on lines +118 to +130
assert JSONProviderRegistry.supports_responses_api("prism") is True
responses_config = ProviderConfigManager.get_provider_responses_api_config(
provider="prism",
model="deepseek-v4-flash",
)
messages_config = ProviderConfigManager.get_provider_anthropic_messages_config(
provider=litellm.LlmProviders.PRISM,
model="deepseek-v4-flash",
)

assert responses_config is not None
assert responses_config.custom_llm_provider == "prism"
assert isinstance(messages_config, JSONProviderAnthropicMessagesConfig)

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 Endpoint Tests Only Resolve Configs

These tests never execute Responses or Messages requests, violating the repository requirement for meaningful functional endpoint tests before merging

Context Used: CLAUDE.md (source)

Knowledge Base Used: Provider adapters and capabilities

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced config-resolution assertions with functional Responses and async Messages requests that verify endpoint routing, authentication, payloads, and parsed responses.

@CLAassistant

CLAassistant commented Sep 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@devin-ai-integration
devin-ai-integration Bot changed the base branch from litellm_internal_staging to main September 23, 2026 14:35
@devin-ai-integration
devin-ai-integration Bot requested a review from a team September 23, 2026 14:35
ryan-crabbe-berri added a commit that referenced this pull request Sep 28, 2026
* feat(providers): add Prism provider

* fix(providers): complete Prism registration

* feat(providers): expose Prism responses and messages

* feat(providers): add DeepSeek V4.1 Flash to Prism

* test(providers): exercise Prism endpoint requests

* fix(providers): align Prism pricing and limits with the live catalog

deepseek-v4.1-flash bills 0.17/0.63 USD per 1M input/output tokens and takes image input;
deepseek-v4-flash bills 0.17/0.21 and caps output at 384000 tokens, per GET /v1/models

* test(prism): assert cost-map invariants instead of pinning catalog facts

* test(prism): derive the asserted model list from the cost map instead of pinning it

* test(prism): capture requests through respx instead of appending to a list and swapping the client transport

---------

Co-authored-by: rajitkhanna <rajitskhanna@gmail.com>
Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com>
Co-authored-by: ryan <ryan@berri.ai>

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.

6 participants