diff --git a/aider/sendchat.py b/aider/sendchat.py index e767e29ce..7e12e36c9 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -1,5 +1,6 @@ import hashlib import json +import os import backoff @@ -57,6 +58,9 @@ def send_completion( temperature=temperature, stream=stream, ) + + if model_name.startswith("deepseek/") and "DEEPSEEK_API_BASE" in os.environ: + kwargs["base_url"] = os.environ["DEEPSEEK_API_BASE"] if functions is not None: kwargs["functions"] = functions if extra_headers is not None: