> ## Documentation Index
> Fetch the complete documentation index at: https://langchain-5e9cc07a-preview-docsdy-1782656769-5d7a089.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Nebius integrations

> Integrate with Nebius using LangChain Python.

All functionality related to Nebius Token Factory

> [Nebius Token Factory](https://tokenfactory.nebius.com/) provides API access to a wide range of state-of-the-art large language models and embedding models for various use cases.

## Installation and setup

The Nebius integration can be installed via pip:

<CodeGroup>
  ```bash pip theme={null}
  pip install langchain-nebius
  ```

  ```bash uv theme={null}
  uv add langchain-nebius
  ```
</CodeGroup>

To use Nebius Token Factory, you'll need an API key which you can obtain from [Nebius Token Factory](https://tokenfactory.nebius.com/). The API key can be passed as an initialization parameter `api_key` or set as the environment variable `NEBIUS_API_KEY`.

```python theme={null}
import os
os.environ["NEBIUS_API_KEY"] = "YOUR-NEBIUS-API-KEY"
```

### Available models

The full list of supported models can be found in the [Nebius Token Factory Models Page](https://tokenfactory.nebius.com/models).

## Chat models

### ChatNebius

The `ChatNebius` class allows you to interact with Nebius Token Factory's chat models.

See a [usage example](/oss/python/integrations/chat/nebius).

```python theme={null}
from langchain_nebius import ChatNebius

# Initialize the chat model
chat = ChatNebius(
    model="moonshotai/Kimi-K2.5",  # Choose from available models
    temperature=0.6,
    top_p=0.95
)
```

## Embedding models

### NebiusEmbeddings

The `NebiusEmbeddings` class allows you to generate vector embeddings using Nebius Token Factory's embedding models.

See a [usage example](/oss/python/integrations/embeddings/nebius).

```python theme={null}
from langchain_nebius import NebiusEmbeddings

# Initialize embeddings
embeddings = NebiusEmbeddings(
    model="Qwen/Qwen3-Embedding-8B"  # Default embedding model
)
```

## Retrievers

### NebiusRetriever

The `NebiusRetriever` enables efficient similarity search using embeddings from Nebius Token Factory. It leverages high-quality embedding models to enable semantic search over documents.

See a [usage example](/oss/python/integrations/retrievers/nebius).

```python theme={null}
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
)
```

## Tools

### NebiusRetrievalTool

The `NebiusRetrievalTool` allows you to create a tool for agents based on the NebiusRetriever.

```python theme={null}
from langchain_nebius import NebiusEmbeddings, NebiusRetriever, NebiusRetrievalTool
from langchain_core.documents import Document

# Create sample documents
docs = [
    Document(page_content="Paris is the capital of France and has the Eiffel Tower"),
    Document(page_content="Berlin is the capital of Germany and has the Brandenburg Gate"),
]

# Create embeddings and retriever
embeddings = NebiusEmbeddings()
retriever = NebiusRetriever(embeddings=embeddings, docs=docs)

# Create retrieval tool
tool = NebiusRetrievalTool(
    retriever=retriever,
    name="nebius_search",
    description="Search for information about European capitals"
)
```

***

<div className="source-links">
  <Callout icon="terminal-2">
    [Connect these docs](/use-these-docs) to Claude, VSCode, and more via MCP for real-time answers.
  </Callout>

  <Callout icon="edit">
    [Edit this page on GitHub](https://github.com/langchain-ai/docs/edit/main/src/oss/python/integrations/providers/nebius.mdx) or [file an issue](https://github.com/langchain-ai/docs/issues/new/choose).
  </Callout>
</div>
