From 7822c1c879a4401b22d4c44e5ea458b3609c6e07 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 12 Aug 2024 15:04:05 -0700 Subject: [PATCH] feat: Add support for DeepSeek API base URL --- aider/sendchat.py | 4 ++++ 1 file changed, 4 insertions(+) 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: