LangChain is the most popular framework for building LLM-powered applications. Since NovAI provides an OpenAI-compatible API, integrating DeepSeek into LangChain takes just a few lines of code.
from langchain_openai import ChatOpenAI
# Point LangChain to NovAI's endpoint
llm = ChatOpenAI(
model="deepseek-v3.2",
openai_api_key="your-novai-api-key",
openai_api_base="https://aiapi-pro.com/v1",
temperature=0.7,
)
response = llm.invoke("Explain the difference between RAG and fine-tuning")
print(response.content)
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
llm = ChatOpenAI(
model="deepseek-v3.2",
openai_api_key="your-novai-api-key",
openai_api_base="https://aiapi-pro.com/v1",
)
prompt = ChatPromptTemplate.from_messages([
("system", "You are an expert {topic} tutor. Explain concepts clearly."),
("human", "{question}"),
])
chain = prompt | llm
result = chain.invoke({"topic": "Python", "question": "What are decorators?"})
print(result.content)
for chunk in llm.stream("Write a Python quicksort implementation"):
print(chunk.content, end="", flush=True)
Since NovAI hosts multiple models, you can easily switch between them:
# Use DeepSeek for code tasks
code_llm = ChatOpenAI(model="deepseek-v3.2", openai_api_key=KEY, openai_api_base=BASE)
# Use MiniMax for long-context tasks (1M tokens)
long_llm = ChatOpenAI(model="minimax-text-01", openai_api_key=KEY, openai_api_base=BASE)
# Use GLM Flash for free prototyping
free_llm = ChatOpenAI(model="glm-4.6v-flash", openai_api_key=KEY, openai_api_base=BASE)
Same API key, same endpoint, just change the model parameter.
Free signup. Works with LangChain, LlamaIndex, and any OpenAI-compatible tool.
Start Free →