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=***
setx DEEPSEEK_API_KEY ***
Example
Use DeepSeek with your Agent:
from phi.agent import Agent, RunResponsefrom phi.model.deepseek import DeepSeekChatagent = 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 terminalagent.print_response("Share a 2 sentence horror story.")
Params
Parameter
Type
Default
Description
id
str
"deepseek-chat"
The specific model ID used for generating responses.
name
str
"DeepSeekChat"
The name identifier for the DeepSeek model.
provider
str
"DeepSeek"
The provider of the model.
api_key
Optional[str]
-
The API key used for authenticating requests to the DeepSeek service. Retrieved from the environment variable DEEPSEEK_API_KEY.
base_url
str
"https://api.deepseek.com"
The base URL for making API requests to the DeepSeek service.