Skip to content

feat(litellm): add Vispark provider with Vision Small/Medium/Large - #41192

Open
vansh-one wants to merge 4 commits into
BerriAI:mainfrom
vansh-one:add-vispark-litellm
Open

vansh-one wants to merge 4 commits into
BerriAI:mainfrom
vansh-one:add-vispark-litellm

Conversation

@vansh-one

Copy link
Copy Markdown

Adds Vispark Lab (https://lab.vispark.in) as an OpenAI-compatible provider with 3 chat models, following the existing JSON-configured provider pattern (cf. darkbloom/scx-ai).

  • model_prices_and_context_window.json (+ byte-identical backup): vispark/vision-small|medium|large — per-token USD costs ($1.05/3.16, $4.21/12.63, $7.37/22.11 per MTok), 1M input / 65K output, chat + completions endpoints, vision/audio/video/pdf + tools/structured-output flags, source link
  • litellm/__init__.py: vispark_models set + router registration
  • litellm/types/utils.py: VISPARK provider enum
  • litellm/constants.py: openai_compatible_providers + text-completion lists

Usage: litellm.completion(model="vispark/vision-medium", api_base="https://api.lab.vispark.in/v1", api_key=...)
Costs verified: cost_per_token returns the published figures exactly. cost_map_guard passes locally.

@vansh-one
vansh-one requested a review from a team September 15, 2026 05:38
@CLAassistant

CLAassistant commented Sep 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codspeed

codspeed Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing vansh-one:add-vispark-litellm (b6a0f61) with main (62a1b7f)1

Open in CodSpeed

Footnotes

  1. No successful run was found on main (7be2983) during the generation of this report, so 62a1b7f was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

@greptile-apps

greptile-apps Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds Vispark's provider enum and model registries, registers it for OpenAI-compatible chat and text-completion routing, and adds pricing, limits, modalities, and capability metadata for Vision Small, Medium, and Large.

  • The primary and backup model metadata files remain synchronized.
  • The provider's JSON registry entry is missing, leaving default endpoint and environment credential resolution incomplete.
  • No focused provider tests accompany the integration.

Confidence Score: 4/5

This PR is not ready to merge because the provider registration lacks the JSON configuration needed for default endpoint and credential resolution, and the repository-required provider tests are absent.

Explicitly configured calls can use generic OpenAI-compatible routing, but Vispark is labeled and registered as a JSON-configured provider without the registry entry that supplies its defaults; the missing focused tests also violate the repository's new-feature testing requirement.

Files Needing Attention: litellm/constants.py, litellm/init.py

Important Files Changed

Filename Overview
litellm/init.py Adds Vispark's model set, cost-map population, global model list inclusion, and provider-to-model mapping, but without focused behavioral tests.
litellm/constants.py Registers Vispark for OpenAI-compatible and text-completion routing while the required JSON provider configuration is absent.
litellm/types/utils.py Adds the Vispark provider enum value consistently with the provider slug.
model_prices_and_context_window.json Adds schema-valid pricing, limits, endpoints, modalities, and capabilities for three Vispark models.
litellm/model_prices_and_context_window_backup.json Mirrors the three new Vispark model entries byte-for-byte from the primary model metadata file.

Reviews (1): Last reviewed commit: "feat(litellm): add Vispark provider with..." | Re-trigger Greptile

Comment thread litellm/constants.py
"ragflow",
"pinstripes", # Pinstripes - JSON-configured provider
"darkbloom",
"vispark", # Vispark Lab - JSON-configured provider

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.

P1 Missing JSON provider registration

This registers vispark as a JSON-configured OpenAI-compatible provider, but there is no corresponding entry in litellm/llms/openai_like/providers.json. The shared JSON provider path therefore cannot supply Vispark's default base URL or environment-backed credentials. Calls that rely on those provider defaults can target the wrong endpoint or fail authentication. This also violates the repository directive that new OpenAI-compatible integrations follow the established provider contribution pattern.

Rule Used: Block new LLM Provider integrations if they're openai compatible and don't follow https://docs.litellm.ai/docs/contributing/adding_openai_compatible_providers (source)

Comment thread litellm/__init__.py Outdated
Comment on lines +945 to +946
elif value.get("litellm_provider") == "vispark":
vispark_models.add(key)

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 Provider tests are missing

This new provider has no focused tests, contrary to the repository requirement that new provider features include meaningful behavioral coverage. Before merging, add tests for registry configuration, provider and model recognition, explicit overrides and default credential resolution, model-prefix stripping, and synchronized model metadata. Without this coverage, CI does not catch incomplete routing registration such as the missing JSON provider entry in this change.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Rebased onto latest main: re-applied vispark registrations (model sets,
provider enum, JSON provider registry, pricing catalogs, dashboard
fields, endpoints matrix) and moved provider test to
tests/unit/llms/openai_like/ per current layout.
@vansh-one

Copy link
Copy Markdown
Author

Ready for review. Rebased onto latest main (was CONFLICTING) and addressed the earlier Greptile findings:

  • litellm/llms/openai_like/providers.json registry entry (default base URL + VISPARK_LAB_API_KEY)
  • provider test added as tests/unit/llms/openai_like/test_vispark_provider.py (11 tests, passing; placed in the new tests/unit layout)
  • dashboard provider_create_fields.json + provider_endpoints_support.json entries

Verified: cost-map-guard ✅, lint (incl. basedpyright + type-discipline budgets) ✅, cost_per_token returns the published figures exactly, root/backup JSONs in sync.

Note: history was rewritten by the rebase (old commits superseded). Requesting review — thank you!

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