Skip to content

Feat/add commandcode provider - #34764

Open
ImajiPietersz wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
ImajiPietersz:feat/add-commandcode-provider
Open

Feat/add commandcode provider#34764
ImajiPietersz wants to merge 2 commits into
BerriAI:litellm_internal_stagingfrom
ImajiPietersz:feat/add-commandcode-provider

Conversation

@ImajiPietersz

Copy link
Copy Markdown

TLDR

Problem this solves:

  • Adds LiteLLM support for CommandCode API endpoints
  • Enables users to call CommandCode models through LiteLLM

How it solves it:

  • Adds OpenAI-compatible CommandCode chat completion support
  • Adds Anthropic-compatible CommandCode messages API support
  • Handles CommandCode API authentication and endpoint routing

Relevant issues

Fixes #27582

Linear ticket

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • 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 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Screenshots / Proof of Fix

  • Verified with make lint
  • Verified formatting, linting, and type checks pass

Type

🆕 New Feature

Changes

  • Added CommandCode provider implementation
  • Added OpenAI-compatible provider routing
  • Added Anthropic-compatible provider routing
  • Added CommandCode API credential handling

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds CommandCode as a chat provider with OpenAI- and Anthropic-compatible routing.

  • Registers CommandCode provider detection, credentials, and pricing metadata.
  • Adds shared HTTP-handler integration for OpenAI-compatible models.
  • Adds a Claude-specific Anthropic dispatch path.
  • Adds configuration and mocked tests for provider URLs and authentication.

Confidence Score: 3/5

The PR is not safe to merge until CommandCode Claude requests are wired to a usable provider configuration and the required authentication behavior.

OpenAI-compatible CommandCode requests use the shared HTTP handler, but every Claude request reaches an Anthropic handler that cannot resolve COMMANDCODE and raises before making the upstream request.

Files Needing Attention: litellm/main.py, litellm/llms/commandcode/chat/transformation.py

Important Files Changed

Filename Overview
litellm/main.py Adds CommandCode dispatch, but the Claude branch cannot resolve or apply its provider configuration.
litellm/llms/commandcode/chat/transformation.py Defines OpenAI and Anthropic endpoint/auth transformations, although the Anthropic configuration is disconnected from runtime dispatch.
litellm/litellm_core_utils/get_llm_provider_logic.py Adds CommandCode prefix detection and OpenAI-compatible credential resolution.
litellm/types/utils.py Registers commandcode in the provider enum.
model_prices_and_context_window.json Adds pricing and capability metadata for two CommandCode models.
tests/test_litellm/llms/commandcode/test_commandcode_chat_transformation.py Covers configuration helpers and the OpenAI runtime path but does not exercise the broken Claude runtime dispatch.

Reviews (1): Last reviewed commit: "Format CommandCode provider changes" | Re-trigger Greptile

Comment thread litellm/main.py

# Claude models → Anthropic format
if "claude" in model.lower():
response = anthropic_chat_completions.completion(

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 Claude provider config is disconnected

When a commandcode/claude-* request reaches this branch, the Anthropic handler looks up LlmProviders.COMMANDCODE, which has no ProviderConfigManager mapping, and raises Provider config not found before sending the request. The instantiated commandcode_anthropic_config is never used here; additionally, the handler validates with the base AnthropicConfig, producing x-api-key authentication instead of CommandCode's required Bearer header.

Rule Used: Block new LLM Provider integrations if they're ope... (source)

Knowledge Base Used: LLM Provider Adapters

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.36585% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
litellm/llms/commandcode/chat/transformation.py 84.44% 7 Missing ⚠️
litellm/main.py 87.09% 4 Missing ⚠️
...tellm/litellm_core_utils/get_llm_provider_logic.py 75.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@codspeed-hq

codspeed-hq Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing ImajiPietersz:feat/add-commandcode-provider (770acef) with litellm_internal_staging (2412326)

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.

[Feature]: Support Command Code API provider (api.commandcode.ai)

1 participant