Is Deepseek-R1 API accessed through openai library compatible with Langchain and Langgraph methods? #29681
leockl
announced in
Ask Dosu (Archived)
Replies: 1 comment 1 reply
-
Yes, the Deepseek-R1 API, accessed through the OpenAI library, is compatible with LangChain methods. You can integrate it using the from langchain_openai.chat_models import ChatOpenAI
llm = ChatOpenAI(
model="deepseek-chat",
api_key="<DeepSeek API Key>",
openai_api_base="https://api.deepseek.com"
) This setup allows you to use the Deepseek-R1 API with LangChain's methods, leveraging the shared structure of API calls and message formatting [1]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Looking at Deepseek-R1's API documentation (https://api-docs.deepseek.com/), based on the script below, Deepseek-R1 can been accessed through
openai
library:Does that mean Deepseek-R1 API (accessed through
openai
library) as shown above is compatible with Langchain and Langgraph methods (such as those infrom langchain_openai import ChatOpenAI
andfrom langgraph.prebuilt import create_react_agent
)?Beta Was this translation helpful? Give feedback.
All reactions