Skip to content

Always access the OpenAI platform when using the DeepSeek model with LitellmModel #773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
qianxiaoming opened this issue May 28, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@qianxiaoming
Copy link

When using the DeepSeek model with LitellmModel, it always requires accessing the OpenAI platform:

import asyncio
import os
from agents import Agent, Runner
from agents.extensions.models.litellm_model import LitellmModel

os.environ["DEEPSEEK_API_KEY"] = "sk-74a*****************f131"

async def main():
    model = LitellmModel(model="deepseek/deepseek-chat", api_key=os.environ["DEEPSEEK_API_KEY"])

    agent = Agent(
        name="Assistant",
        instructions="You only respond in haikus.",
        model=model,
    )

    result = await Runner.run(agent, "Tell me about recursion in programming.")
    print(result.final_output)

if __name__ == "__main__":
    asyncio.run(main())

This script output these:

[non-fatal] Tracing client error 401: {
  "error": {
    "message": "Incorrect API key provided: sk-74a47***********************f131. You can find your API key at https://platform.openai.com/account/api-keys.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}
Recursion calls self,  
Like a loop but with functions,  
Base case ends the chain.
[non-fatal] Tracing client error 401: {
  "error": {
    "message": "Incorrect API key provided: sk-74a47***********************f131. You can find your API key at https://platform.openai.com/account/api-keys.",
    "type": "invalid_request_error",
    "param": null,
    "code": "invalid_api_key"
  }
}

Debug information

  • Agents SDK version: (v0.0.16)
  • Python version (3.11)
@qianxiaoming qianxiaoming added the bug Something isn't working label May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant