From 5b8e19ab3cf12205304807b5bff3b1483420722a Mon Sep 17 00:00:00 2001 From: chyroc Date: Thu, 27 Aug 2026 22:07:39 +0800 Subject: [PATCH] feat(volcengine): add the Seed 2.1 flagship models MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The catalog carries four Volcengine Ark chat models, all Seed 2.0 -260215, so the current flagship line is missing. Adds doubao-seed-2-1-pro-260628 and doubao-seed-2-1-turbo-260628 to both the root map and the packaged backup. Limits and capabilities come from Ark's model list (docs/82379/1330310), which gives 256k context and 256k max output for both, and lists 深度思考 (reasoning), 多模态理解 (vision) and 工具调用 (tools). Each was also confirmed against POST /api/v3/chat/completions: - max_tokens=256000 accepted, 300000 rejected as invalid - reasoning_effort low/high yields 61/107 reasoning tokens on pro - an image_url data URL is ingested (prompt_tokens rises 55 -> 1353) - tool calls come back in the standard tool_calls shape supports_tool_choice stays false, matching the existing volcengine entries: a forced function is honoured, but tool_choice="none" is ignored and the model calls the tool anyway, so the parameter is only partly supported. Pricing is Ark's standard 在线推理(常规)tier from docs/82379/1544106 — pro CNY 6/1.2/30 and turbo CNY 3/0.6/15 per 1M input/cache-hit/output — converted at 6.737012 CNY/USD. Note the doc also has a 低延迟 tier at double these rates; the standard tier is used here. Change-Id: I79d9c5a9b8c3048b2acf9d73ced73bb20bee4ecd --- ...odel_prices_and_context_window_backup.json | 30 ++++++++ model_prices_and_context_window.json | 30 ++++++++ .../test_volcengine_model_catalog.py | 74 +++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 tests/test_litellm/llms/volcengine/test_volcengine_model_catalog.py diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index dd367e875de..0c369314139 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -50139,6 +50139,36 @@ } ] }, + "volcengine/doubao-seed-2-1-pro-260628": { + "cache_read_input_token_cost": 1.78120508023e-07, + "input_cost_per_token": 8.90602540117e-07, + "litellm_provider": "volcengine", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 4.45301270059e-06, + "source": "https://www.volcengine.com/docs/82379/1330310", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": false, + "supports_vision": true + }, + "volcengine/doubao-seed-2-1-turbo-260628": { + "cache_read_input_token_cost": 8.90602540117e-08, + "input_cost_per_token": 4.45301270059e-07, + "litellm_provider": "volcengine", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 2.22650635029e-06, + "source": "https://www.volcengine.com/docs/82379/1330310", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": false, + "supports_vision": true + }, "bedrock/us-east-1/zai.glm-5": { "input_cost_per_token": 1e-06, "output_cost_per_token": 3.2e-06, diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json index dd367e875de..0c369314139 100644 --- a/model_prices_and_context_window.json +++ b/model_prices_and_context_window.json @@ -50139,6 +50139,36 @@ } ] }, + "volcengine/doubao-seed-2-1-pro-260628": { + "cache_read_input_token_cost": 1.78120508023e-07, + "input_cost_per_token": 8.90602540117e-07, + "litellm_provider": "volcengine", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 4.45301270059e-06, + "source": "https://www.volcengine.com/docs/82379/1330310", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": false, + "supports_vision": true + }, + "volcengine/doubao-seed-2-1-turbo-260628": { + "cache_read_input_token_cost": 8.90602540117e-08, + "input_cost_per_token": 4.45301270059e-07, + "litellm_provider": "volcengine", + "max_input_tokens": 256000, + "max_output_tokens": 256000, + "max_tokens": 256000, + "mode": "chat", + "output_cost_per_token": 2.22650635029e-06, + "source": "https://www.volcengine.com/docs/82379/1330310", + "supports_function_calling": true, + "supports_reasoning": true, + "supports_tool_choice": false, + "supports_vision": true + }, "bedrock/us-east-1/zai.glm-5": { "input_cost_per_token": 1e-06, "output_cost_per_token": 3.2e-06, diff --git a/tests/test_litellm/llms/volcengine/test_volcengine_model_catalog.py b/tests/test_litellm/llms/volcengine/test_volcengine_model_catalog.py new file mode 100644 index 00000000000..69f9b4863ee --- /dev/null +++ b/tests/test_litellm/llms/volcengine/test_volcengine_model_catalog.py @@ -0,0 +1,74 @@ +""" +Tests for the Volcengine Ark model catalog entries. + +These assert the properties that were checked against the live Ark API +(POST https://ark.cn-beijing.volces.com/api/v3/chat/completions) so a future +edit cannot silently contradict them. +""" + +import pytest + +from litellm import get_model_info + + +SEED_2_1_FLAGSHIPS = [ + "volcengine/doubao-seed-2-1-pro-260628", + "volcengine/doubao-seed-2-1-turbo-260628", +] + + +@pytest.mark.parametrize("model", SEED_2_1_FLAGSHIPS) +def test_seed_2_1_flagship_is_registered(model): + """Both flagships must resolve through get_model_info with the volcengine provider.""" + info = get_model_info(model=model) + assert info["litellm_provider"] == "volcengine" + assert info["mode"] == "chat" + + +@pytest.mark.parametrize("model", SEED_2_1_FLAGSHIPS) +def test_seed_2_1_flagship_limits(model): + """Ark documents 256k context and 256k max output for both models. + + The 256k output ceiling was also probed directly: max_tokens=256000 is + accepted and 300000 is rejected with "max_tokens ... not valid". + """ + info = get_model_info(model=model) + assert info["max_input_tokens"] == 256000 + assert info["max_output_tokens"] == 256000 + + +@pytest.mark.parametrize("model", SEED_2_1_FLAGSHIPS) +def test_seed_2_1_flagship_capabilities(model): + """Reasoning, vision and function calling were each confirmed against the API. + + supports_tool_choice stays False, matching the other volcengine entries: + a forced function is honoured, but tool_choice="none" is ignored and the + model calls the tool anyway, so the parameter is not fully supported. + """ + info = get_model_info(model=model) + assert info["supports_reasoning"] is True + assert info["supports_vision"] is True + assert info["supports_function_calling"] is True + assert info["supports_tool_choice"] is False + + +def test_seed_2_1_pro_is_priced_above_turbo(): + """Ark lists pro at CNY 6/30 per 1M and turbo at CNY 3/15, i.e. turbo is half. + + Asserting the ratio rather than absolute figures keeps the test meaningful + if the CNY-to-USD rate is refreshed later. + """ + pro = get_model_info(model="volcengine/doubao-seed-2-1-pro-260628") + turbo = get_model_info(model="volcengine/doubao-seed-2-1-turbo-260628") + + assert pro["input_cost_per_token"] == pytest.approx( + turbo["input_cost_per_token"] * 2, rel=1e-6 + ) + assert pro["output_cost_per_token"] == pytest.approx( + turbo["output_cost_per_token"] * 2, rel=1e-6 + ) + # cache-hit pricing is a fifth of the input price on both + for info in (pro, turbo): + assert info["cache_read_input_token_cost"] == pytest.approx( + info["input_cost_per_token"] / 5, rel=1e-6 + )