Commit Graph
7 Commits
Author SHA1 Message Date
Ishaan Jaffer e8461b5b97 style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
4e32479e7d feat(dashscope): preserve cache_control for explicit prompt caching (#25331)
DashScope inherits OpenAIGPTConfig which strips cache_control from
messages and tools by default. Override remove_cache_control_flag_from_messages_and_tools()
to preserve cache_control, following the same pattern used by ZAI, MiniMax, and Databricks.

Verified through 10-round multi-turn conversation tests:
- Explicit caching works correctly: cached_tokens grows each round from R4 onwards,
  with cache_creation_tokens reported on first cache build.
- Implicit caching is not affected: models that rely on implicit prefix-matching caching
  produce identical cached_tokens with and without this change, confirmed by comparing
  results against both the reverted codebase and direct API calls bypassing litellm.
- No errors or regressions observed on any model, including those that do not support
  explicit caching — the DashScope API silently ignores unrecognized cache_control fields.

Fixes #25330

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-08 21:32:04 -07:00
ZeroAurora 64c916b37b fix: remove list-to-str transformation from dashscope 2026-02-19 07:30:13 +00:00
Alan PonnachanandGitHub 45cf6fc289 feat: support dashscope tiered pricing
* add helper functions

* update generic_cost_per_token function

* add test

* formatting

* add examples in docstring for _calculate_tiered_cost

* Restore files to upstream/main version

* dashscope specific calculation

* improve for different costs

* remove _calculate_flat_cost function
2025-11-03 20:27:25 -08:00
Ishaan JaffandGitHub 32d87c242b [Fixes] Using Qwen API Tiered Pricing (#14479)
* fix: use dashscope cost calc

* add qwen logo
2025-09-11 20:07:41 -07:00
Ishaan JaffandGitHub dda115cc6d [Feat] Cost Tracking - Add support for Tiered Cost Tracking for Qwen API (Dashscope) (#14471)
* add dashscope logo

* docs fix

* docs fix

* fix supports_batch_calling

* fix naming

* fix input_cost_per_audio_token

* use output_cost_per_reasoning_token

* add tiered_pricing in get_model_info

* test fixes

* fix cost calc

* ruff fix
2025-09-11 18:14:39 -07:00
minghaoandGitHub bee63a1ae7 Added dashscope (alibaba's cloud - qwen) as a provider (#12361)
* Added dashscope as a provider

* Fix some leftover references on nebius

* Porting the dashscope api endpoit international version

* explicit tool_choice = True in config
2025-07-10 18:09:26 -07:00