mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-06 22:12:12 +02:00
fix(model_resolver): supply dummy API key for LM Studio when not provided
This commit is contained in:
parent
7093b4d4d0
commit
31ec939da9
2 changed files with 20 additions and 0 deletions
|
|
@ -59,6 +59,10 @@ def to_litellm(
|
|||
kwargs: dict[str, Any] = {}
|
||||
if api_key:
|
||||
kwargs["api_key"] = api_key
|
||||
elif provider == "lm_studio":
|
||||
# LiteLLM's OpenAI-compatible adapter expects an api_key value even
|
||||
# when LM Studio accepts unauthenticated local requests.
|
||||
kwargs["api_key"] = "not-needed"
|
||||
|
||||
prefix = spec.litellm_prefix or str(provider)
|
||||
model_string = f"{prefix}/{model_id}" if prefix else model_id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue