Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

fix(cognition): restore Lightning SWE pricing and declare responses support

mateo-berri1a9e9951e124
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index d63a888ae9c..5d859a05963 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -48486,9 +48486,9 @@
"source": "https://docs.devin.ai/windsurf/plugins/cascade/models"
},
"cognition/swe-1.7": {
- "input_cost_per_token": 5e-07,
- "output_cost_per_token": 2.5e-06,
- "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2.5e-06,
+ "output_cost_per_token": 1.25e-05,
+ "cache_read_input_token_cost": 1e-06,
"litellm_provider": "cognition",
"mode": "chat",
"supports_function_calling": true,
diff --git a/litellm/provider_endpoints_support_backup.json b/litellm/provider_endpoints_support_backup.json
index d47d74ead28..b4d635c0fba 100644
--- a/litellm/provider_endpoints_support_backup.json
+++ b/litellm/provider_endpoints_support_backup.json
@@ -534,7 +534,7 @@
"endpoints": {
"chat_completions": true,
"messages": true,
- "responses": false,
+ "responses": true,
"embeddings": false,
"image_generations": false,
"audio_transcriptions": false,
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index d63a888ae9c..5d859a05963 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -48486,9 +48486,9 @@
"source": "https://docs.devin.ai/windsurf/plugins/cascade/models"
},
"cognition/swe-1.7": {
- "input_cost_per_token": 5e-07,
- "output_cost_per_token": 2.5e-06,
- "cache_read_input_token_cost": 2e-07,
+ "input_cost_per_token": 2.5e-06,
+ "output_cost_per_token": 1.25e-05,
+ "cache_read_input_token_cost": 1e-06,
"litellm_provider": "cognition",
"mode": "chat",
"supports_function_calling": true,
diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json
index 950bf61dbb7..7c1ca34c23c 100644
--- a/provider_endpoints_support.json
+++ b/provider_endpoints_support.json
@@ -569,7 +569,7 @@
"endpoints": {
"chat_completions": true,
"messages": true,
- "responses": false,
+ "responses": true,
"embeddings": false,
"image_generations": false,
"audio_transcriptions": false,
diff --git a/tests/test_litellm/llms/openai_like/test_cognition_provider.py b/tests/test_litellm/llms/openai_like/test_cognition_provider.py
index 6dcc02387cc..c358d178f60 100644
--- a/tests/test_litellm/llms/openai_like/test_cognition_provider.py
+++ b/tests/test_litellm/llms/openai_like/test_cognition_provider.py
@@ -114,7 +114,7 @@ class TestCognitionCostTracking:
"model, input_cost, output_cost",
[
("cognition/swe-1.6", 5e-07, 2.5e-06),
- ("cognition/swe-1.7", 5e-07, 2.5e-06),
+ ("cognition/swe-1.7", 2.5e-06, 1.25e-05),
],
)
def test_cost_map_entries(self, model: str, input_cost: float, output_cost: float):
@@ -136,14 +136,16 @@ class TestCognitionCostTracking:
custom_llm_provider="cognition",
)
- assert prompt_cost == pytest.approx(0.5)
- assert completion_cost == pytest.approx(2.5)
+ assert prompt_cost == pytest.approx(2.5)
+ assert completion_cost == pytest.approx(12.5)
def test_supported_endpoints_matrix(self):
matrix = json.loads((Path(litellm.__file__).parent / "provider_endpoints_support_backup.json").read_text())
endpoints = matrix["providers"]["cognition"]["endpoints"]
assert endpoints["chat_completions"] is True
+ assert endpoints["messages"] is True
+ assert endpoints["responses"] is True
assert endpoints["embeddings"] is False
@@ -169,5 +171,5 @@ class TestCognitionRouting:
)
usage = response.usage
- expected = usage.prompt_tokens * 5e-07 + usage.completion_tokens * 2.5e-06
+ expected = usage.prompt_tokens * 2.5e-06 + usage.completion_tokens * 1.25e-05
assert response._hidden_params["response_cost"] == pytest.approx(expected)