DeepSeek is a platform for providing endpoints for Large Language models.

Authentication

Set your DEEPSEEK_API_KEY environment variable. Get your key from here.

export DEEPSEEK_API_KEY=***

Example

Use DeepSeek with your Agent:

from phi.agent import Agent, RunResponse
from phi.model.deepseek import DeepSeekChat

agent = Agent(model=DeepSeekChat(), markdown=True)

# Get the response in a variable
# run: RunResponse = agent.run("Share a 2 sentence horror story.")
# print(run.content)

# Print the response in the terminal
agent.print_response("Share a 2 sentence horror story.")

Params

ParameterTypeDefaultDescription
idstr"deepseek-chat"The specific model ID used for generating responses.
namestr"DeepSeekChat"The name identifier for the DeepSeek model.
providerstr"DeepSeek"The provider of the model.
api_keyOptional[str]-The API key used for authenticating requests to the DeepSeek service. Retrieved from the environment variable DEEPSEEK_API_KEY.
base_urlstr"https://api.deepseek.com"The base URL for making API requests to the DeepSeek service.

DeepSeek also supports the params of OpenAI.