Skip to content

fix(s3): --provider deepseek hit api.openai.com; document DeepSeek, Qwen and all other providers - #237

Open
sahiljagtap08 wants to merge 1 commit into
simular-ai:mainfrom
sahiljagtap08:fix/deepseek-provider-base-url
Open

sahiljagtap08 wants to merge 1 commit into
simular-ai:mainfrom
sahiljagtap08:fix/deepseek-provider-base-url

Conversation

@sahiljagtap08

Copy link
Copy Markdown

Closes #158

#158 asks whether Qwen and DeepSeek are supported. They already are (engine_type qwen and deepseek in LMMAgent), but neither is mentioned anywhere in the README, and the DeepSeek path is broken from the CLI.

Bug

LMMAgent fills in DeepSeek's default endpoint only when the base_url key is absent:

elif engine_type == "deepseek":
    if "base_url" not in engine_params:

cli_app.py always builds engine_params with "base_url": args.model_url, which is "" unless --model_url is given. So agent_s --provider deepseek --model deepseek-chat constructs LMMEngineOpenAI(base_url=""), and since that engine treats a falsy base_url as "use the default", the DeepSeek API key is sent to api.openai.com and the run fails with an OpenAI auth error. The qwen branch already checks not engine_params.get("base_url"); deepseek now does the same.

Reproduction on main:

os.environ["DEEPSEEK_API_KEY"] = "sk-x"
LMMAgent({"engine_type": "deepseek", "model": "deepseek-chat", "base_url": "", "api_key": ""}).engine.base_url
# ''   -> should be 'https://api.deepseek.com/v1'

Docs

  • README gains a Supported Providers table under the CLI section: every accepted --provider value, the credential env var it reads, and how its endpoint is resolved (verified against engine.py / mllm.py). It includes a Qwen-on-DashScope example and notes that self-hosted Qwen-VL / DeepSeek behind vLLM, SGLang etc. work via --provider openai --model_url.
  • --provider CLI help lists the accepted values instead of "openai, anthropic, etc.".

Tests

Added to tests/test_providers.py:

  • CLI-shaped params (base_url="", api_key="") resolve DeepSeek's and Qwen's default endpoints and pick up the key from the environment. The DeepSeek case fails on main ('' != 'https://api.deepseek.com/v1') and passes with the fix.
  • an explicit DeepSeek base_url is kept
  • missing DEEPSEEK_API_KEY / QWEN_API_KEY raise the documented error
  • an unknown provider raises
$ python -m pytest tests/test_providers.py -q
11 passed
$ black --check gui_agents/s3/core/mllm.py gui_agents/s3/cli_app.py tests/test_providers.py
3 files would be left unchanged.

…t DeepSeek, Qwen and the other providers

The deepseek branch in LMMAgent only filled in the default endpoint when the
base_url key was absent. The CLI always passes base_url="", so running
agent_s --provider deepseek constructed an OpenAI client with no base_url,
which sent the DeepSeek API key to api.openai.com and failed with an auth
error. The qwen branch already checked for an empty value; deepseek now does
the same, and an explicit base_url is still honoured.

Neither provider was documented, which is what simular-ai#158 asked about. The README
gains a table of every supported --provider value with its credential and
endpoint variables plus a Qwen example, and the --provider CLI help lists the
accepted values instead of "etc.".

Closes simular-ai#158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Does this framework have plans to support Qwen and DeepSeek?

1 participant