Nebius Chat Models
This page will help you get started with Nebius AI Studio chat models. For detailed documentation of all ChatNebius features and configurations head to the API reference.
Nebius AI Studio provides API access to a wide range of state-of-the-art large language models and embedding models for various use cases.
Overview
Integration details
Class | Package | Local | Serializable | JS support | Package downloads | Package latest |
---|---|---|---|---|---|---|
ChatNebius | langchain-nebius | ❌ | beta | ❌ |
Model features
Tool calling | Structured output | JSON mode | Image input | Audio input | Video input | Token-level streaming | Native async | Token usage | Logprobs |
---|---|---|---|---|---|---|---|---|---|
✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ |
Setup
To access Nebius models you'll need to create a Nebius account, get an API key, and install the langchain-nebius
integration package.
Installation
The Nebius integration can be installed via pip:
%pip install --upgrade langchain-nebius
Credentials
Nebius requires an API key that can be passed as an initialization parameter api_key
or set as the environment variable NEBIUS_API_KEY
. You can obtain an API key by creating an account on Nebius AI Studio.
import getpass
import os
# Make sure you've set your API key as an environment variable
if "NEBIUS_API_KEY" not in os.environ:
os.environ["NEBIUS_API_KEY"] = getpass.getpass("Enter your Nebius API key: ")
Instantiation
Now we can instantiate our model object to generate chat completions:
from langchain_nebius import ChatNebius
# Initialize the chat model
chat = ChatNebius(
# api_key="YOUR_API_KEY", # You can pass the API key directly
model="Qwen/Qwen3-14B", # Choose from available models
temperature=0.6,
top_p=0.95,
)
Invocation
You can use the invoke
method to get a completion from the model:
response = chat.invoke("Explain quantum computing in simple terms")
print(response.content)
<think>
Okay, so I need to explain quantum computing in simple terms. Hmm, where do I start? Let me think. I know that quantum computing uses qubits instead of classical bits. But what's a qubit? Oh right, classical bits are 0 or 1, but qubits can be both at the same time, right? That's superposition. Wait, how does that work exactly?
Maybe I should start by comparing it to regular computers. Regular computers use bits that are either 0 or 1. Like a light switch that's either on or off. Quantum computers use qubits, which can be in a state of 0, 1, or both at the same time. That's the superposition part. So, if you have two qubits, they can represent four states at once? Like 00, 01, 10, 11 all at the same time? That seems powerful. So with more qubits, the number of possible states grows exponentially. That's why quantum computers can process a lot of information quickly.
But then there's entanglement. What's that? If two qubits are entangled, the state of one instantly affects the other, no matter the distance. So if you measure one, you know the state of the other. That's used in quantum algorithms, I think. But how does that help in computing?
Also, quantum computers use quantum gates instead of classical logic gates. These gates manipulate qubits through operations like Hadamard, Pauli, etc. But maybe that's too technical for a simple explanation.
Then there's the issue of decoherence. Qubits are fragile and can lose their quantum state quickly. That's why quantum computers need to be kept at very low temperatures, like near absolute zero, to minimize interference from the environment. But maybe I shouldn't mention that unless it's relevant for the simple explanation.
Applications of quantum computing include things like factoring large numbers (Shor's algorithm), which is important for cryptography, or simulating quantum systems for chemistry and materials science. But again, maybe keep it simple.
Wait, the user wants it in simple terms. So avoid jargon as much as possible. Use analogies. Maybe compare qubits to spinning coins? When a coin is spinning, it's both heads and tails until it lands. So qubits are like spinning coins that can be in multiple states until measured. Then, when you measure, it collapses to a single state.
But how does that help in computation? Maybe think of it as being able to process many possibilities at once, so for certain problems, you can find the answer faster. Like solving a maze by checking all paths at the same time instead of one by one.
Also, mention that quantum computers aren't replacing classical computers. They're better for specific tasks, like optimization, cryptography, or simulations that are hard for classical computers. But for everyday tasks, classical computers are still better.
I should structure this: start with classical bits vs qubits, explain superposition and entanglement with simple analogies, mention how it's used, and note the current limitations. Avoid getting too technical, keep it conversational.
</think>
Quantum computing is a type of computing that uses the principles of **quantum mechanics** to process information in ways that classical computers can't. Here's a simple breakdown:
### 1. **Bits vs. Qubits**
- **Classical computers** use *bits*, which are like switches that can be either **0** (off) or **1** (on).
- **Quantum computers** use *qubits*, which are like "spinning coins." While spinning, a qubit can be **0**, **1**, or **both at the same time** (this is called **superposition**). Only when you "look" at the qubit (measure it) does it settle into a definite state (0 or 1).
### 2. **Superposition: Doing Many Things at Once**
- Imagine a coin spinning in the air. While it's spinning, it’s not just "heads" or "tails"