diff --git a/aider/__init__.py b/aider/__init__.py index e50c05d14b7..ffea43fcd2b 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ from packaging import version -__version__ = "0.87.10.dev" +__version__ = "0.87.11.dev" safe_version = __version__ try: diff --git a/aider/models.py b/aider/models.py index a5ed81fce7a..f07b90dd5df 100644 --- a/aider/models.py +++ b/aider/models.py @@ -8,7 +8,6 @@ import sys import time from dataclasses import dataclass, fields -from datetime import datetime from pathlib import Path from typing import Optional, Union @@ -903,57 +902,6 @@ def is_deepseek_r1(self): def is_ollama(self): return self.name.startswith("ollama/") or self.name.startswith("ollama_chat/") - def github_copilot_token_to_open_ai_key(self, extra_headers): - # check to see if there's an openai api key - # If so, check to see if it's expire - openai_api_key = "OPENAI_API_KEY" - - if openai_api_key not in os.environ or ( - int(dict(x.split("=") for x in os.environ[openai_api_key].split(";"))["exp"]) - < int(datetime.now().timestamp()) - ): - import requests - - class GitHubCopilotTokenError(Exception): - """Custom exception for GitHub Copilot token-related errors.""" - - pass - - # Validate GitHub Copilot token exists - if "GITHUB_COPILOT_TOKEN" not in os.environ: - raise KeyError("GITHUB_COPILOT_TOKEN environment variable not found") - - github_token = os.environ["GITHUB_COPILOT_TOKEN"] - if not github_token.strip(): - raise KeyError("GITHUB_COPILOT_TOKEN environment variable is empty") - - headers = { - "Authorization": f"Bearer {os.environ['GITHUB_COPILOT_TOKEN']}", - "Editor-Version": extra_headers["Editor-Version"], - "Copilot-Integration-Id": extra_headers["Copilot-Integration-Id"], - "Content-Type": "application/json", - } - - url = "https://api.github.com/copilot_internal/v2/token" - res = requests.get(url, headers=headers) - if res.status_code != 200: - safe_headers = {k: v for k, v in headers.items() if k != "Authorization"} - token_preview = github_token[:5] + "..." if len(github_token) >= 5 else github_token - safe_headers["Authorization"] = f"Bearer {token_preview}" - raise GitHubCopilotTokenError( - f"GitHub Copilot API request failed (Status: {res.status_code})\n" - f"URL: {url}\n" - f"Headers: {json.dumps(safe_headers, indent=2)}\n" - f"JSON: {res.text}" - ) - - response_data = res.json() - token = response_data.get("token") - if not token: - raise GitHubCopilotTokenError("Response missing 'token' field") - - os.environ[openai_api_key] = token - def send_completion( self, messages, functions, stream, temperature=None, tools=None, max_tokens=None ): @@ -1029,8 +977,6 @@ def send_completion( "Copilot-Integration-Id": "vscode-chat", } - self.github_copilot_token_to_open_ai_key(kwargs["extra_headers"]) - try: res = litellm.completion(**kwargs) except Exception as err: diff --git a/aider/resources/model-metadata.json b/aider/resources/model-metadata.json index a167ba82370..36221400808 100644 --- a/aider/resources/model-metadata.json +++ b/aider/resources/model-metadata.json @@ -1,6 +1,6 @@ { "deepseek/deepseek-reasoner": { - "max_tokens": 64000, + "max_tokens": 128000, "max_input_tokens": 128000, "max_output_tokens": 64000, "input_cost_per_token": 0.00000028, @@ -15,9 +15,9 @@ "supports_prompt_caching": true }, "deepseek/deepseek-chat": { - "max_tokens": 8192, + "max_tokens": 128000, "max_input_tokens": 128000, - "max_output_tokens": 8192, + "max_output_tokens": 8000, "input_cost_per_token": 0.00000028, "input_cost_per_token_cache_hit": 0.000000028, "cache_read_input_token_cost": 0.000000028,