feat(wavespeed): add WaveSpeedAI as an OpenAI-compatible LLM provider#34620
feat(wavespeed): add WaveSpeedAI as an OpenAI-compatible LLM provider#34620devin-ai-integration[bot] wants to merge 3 commits into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryAdds WaveSpeedAI as a JSON-configured OpenAI-compatible provider, including provider resolution, Chat Completions, Responses and Messages endpoint registration, model pricing and capability metadata, and focused provider and cost-calculation tests Confidence Score: 5/5The PR appears safe to merge; the new provider follows the existing JSON-configured OpenAI-compatible integration paths without an identified actionable defect Provider resolution, enum and registry wiring, endpoint configuration, model-prefix preservation, and pricing fields are coordinated, and the specialized pricing keys are supported by the existing generic cost-calculation path
|
| Filename | Overview |
|---|---|
| litellm/llms/openai_like/providers.json | Registers WaveSpeedAI through the existing JSON provider framework with the expected credentials, base URL, and supported API surfaces |
| litellm/litellm_core_utils/get_llm_provider_logic.py | Adds API-base autodetection for WaveSpeedAI while preserving the established provider-prefix resolution behavior |
| litellm/constants.py | Adds WaveSpeedAI to the OpenAI-compatible endpoint and provider registries |
| litellm/types/utils.py | Adds the WaveSpeedAI provider identifier to the central provider enum |
| model_prices_and_context_window.json | Adds WaveSpeed model pricing, context limits, conditional pricing tiers, and capability metadata using fields consumed by the existing cost calculator |
| litellm/model_prices_and_context_window_backup.json | Mirrors the WaveSpeed model metadata in the local backup cost map |
| provider_endpoints_support.json | Advertises the three API surfaces declared by the WaveSpeed JSON provider configuration |
| tests/test_litellm/llms/openai_like/test_wavespeed_provider.py | Covers provider registration, prefix preservation, environment resolution, endpoint URL generation, model capabilities, standard cost calculation, and long-context pricing |
Reviews (1): Last reviewed commit: "feat(wavespeed): add WaveSpeedAI as an O..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
How it solves it:
wavespeedas a JSON-configured OpenAI-compatible providerRelevant issues
Partially addresses #34618 (LLM API half; media generation is not covered)
Linear ticket
Pre-Submission checklist
Delays in PR merge?
If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).
Screenshots / Proof of Fix
Not captured yet; I don't have a WaveSpeedAI API key, so no live call was made. Once a
WAVESPEED_API_KEYis available the proof iswith a proxy config entry of
model: wavespeed/anthropic/claude-opus-4.8, then checking the spend log at http://localhost:4000/ui/?page=logs shows a non-zero cost computed from the new cost map entryType
🆕 New Feature
Changes
WaveSpeedAI's LLM service is an OpenAI-compatible gateway at
https://llm.wavespeed.ai/v1that also natively exposes/v1/responsesand Anthropic/v1/messages, so it fits the existing JSON provider registry rather than needing a Python config class;providers.jsongains awavespeedentry declaring those three endpoints,WAVESPEED_API_KEY, andWAVESPEED_API_BASE, and the usual registration points (LlmProviders,openai_compatible_providers,openai_compatible_endpoints, api-base autodetection inget_llm_provider,provider_endpoints_support.json) are updated to matchWaveSpeed model ids already carry an upstream provider prefix (
anthropic/claude-opus-4.8), so a route readswavespeed/anthropic/claude-opus-4.8and only the leadingwavespeed/may be stripped; there's a test pinning that, since this is where the OpenRouter-style double-prefix bug would show upThe 92 cost map entries were generated from WaveSpeed's public catalog at https://llm.wavespeed.ai/v1/models, which publishes context windows, per-token prices, cache prices and per-model
supported_parameters; those map tomax_input_tokens/max_output_tokens,input_cost_per_token/output_cost_per_token,cache_read_input_token_cost/cache_creation_input_token_cost(pluscache_creation_input_token_cost_above_1hrfor the Claude 1h cache tier), and thesupports_function_calling/supports_tool_choice/supports_response_schema/supports_reasoning/supports_web_searchflags. Models with tiered long-context pricing (Qwen, Gemini, MiniMax) getinput_cost_per_token_above_256k_tokens-style keys derived from the catalog'sconditional_prices, so a 300k-token Qwen 3.6 Flash request bills at the long-context rateThe catalog publishes no vision, pdf, adaptive-thinking or sampling-param flags, so those four are inherited from the canonical cost map entry for the same underlying model when one exists (
wavespeed/anthropic/claude-fable-5picks upsupports_adaptive_thinking: trueandsupports_sampling_params: falsefromclaude-fable-5, which the repo's cross-variant consistency tests require); models with no canonical counterpart simply omit them rather than being guessed from the name. Media generation (/v1/predictions, the Replicate-style async submit/poll API in the issue) is a separate surface and isn't part of this PRFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/e43399c20a854c7c90fc003efacc40f7