Documentation Index
Fetch the complete documentation index at: https://docs.tokenfactory.nebius.com/llms.txt
Use this file to discover all available pages before exploring further.
Langchain
LangChain is an open-source framework that helps developers build applications powered by Large Language Models (LLMs), by providing tools to connect models with data, APIs, and external systems.
Langchain docs
Langchain + Nebius Token Factory docs
Prerequisites
-
Create an API key to authorize requests to Nebius Token Factory.
-
Save the API key into a
NEBIUS_API_KEY environment variable:
export NEBIUS_API_KEY="<API_key>"
-
Install the
langchain package:
pip install langchain-nebius
Chat Models
from langchain_nebius import ChatNebius
# Initialize the chat model
chat = ChatNebius(
model="Qwen/Qwen3-30B-A3B-fast", # Choose from available models
temperature=0.6,
top_p=0.95
)
Embedding Models
from langchain_nebius import NebiusEmbeddings
embeddings = NebiusEmbeddings(
model="BAAI/bge-en-icl" # Default embedding model
)
Retrievers
from langchain_core.documents import Document
from langchain_nebius import NebiusEmbeddings, NebiusRetriever
# Create sample documents
docs = [
Document(page_content="Paris is the capital of France"),
Document(page_content="Berlin is the capital of Germany"),
]
# Initialize embeddings
embeddings = NebiusEmbeddings()
# Create retriever
retriever = NebiusRetriever(
embeddings=embeddings,
docs=docs,
k=2 # Number of documents to return
)