{"id":4603,"library":"langchain-nebius","title":"LangChain Nebius Integration","description":"This package provides LangChain integration for Nebius AI Studio, enabling seamless use of Nebius AI Studio's chat and embedding models within LangChain. It offers classes for chat models (ChatNebius), embedding models (NebiusEmbeddings), and a retriever (NebiusRetriever), facilitating common LLM application patterns like RAG. The current version is 0.1.3.","status":"active","version":"0.1.3","language":"en","source_language":"en","source_url":"https://github.com/nebius/langchain-nebius","tags":["LangChain","LLM","AI","embeddings","retrieval","Nebius","chat models","RAG"],"install":[{"cmd":"pip install langchain-nebius","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core abstractions for LangChain integrations.","package":"langchain-core","optional":false}],"imports":[{"symbol":"ChatNebius","correct":"from langchain_nebius import ChatNebius"},{"symbol":"NebiusEmbeddings","correct":"from langchain_nebius import NebiusEmbeddings"},{"symbol":"NebiusRetriever","correct":"from langchain_nebius import NebiusRetriever"},{"symbol":"NebiusRetrievalTool","correct":"from langchain_nebius import NebiusRetrievalTool"}],"quickstart":{"code":"import os\nfrom langchain_nebius import ChatNebius\nfrom langchain_core.messages import HumanMessage\n\n# Set your Nebius API key as an environment variable\n# os.environ[\"NEBIUS_API_KEY\"] = \"your_nebius_api_key\"\n\nchat = ChatNebius(\n    api_key=os.environ.get('NEBIUS_API_KEY', ''),\n    model=\"Qwen/Qwen3-14B\", # Choose an available model from Nebius AI Studio\n    temperature=0.6\n)\n\nresponse = chat.invoke([\n    HumanMessage(content=\"What is 1 + 1?\")\n])\n\nprint(response.content)","lang":"python","description":"This example demonstrates how to initialize `ChatNebius` and invoke it with a simple query. Ensure your `NEBIUS_API_KEY` is set as an environment variable for secure credential management. You may need to select a specific model available in Nebius AI Studio."},"warnings":[{"fix":"Set `export NEBIUS_API_KEY='your_api_key'` in your environment or use a `.env` file and `dotenv`.","message":"API Key Management: Nebius requires an API key for authentication. It's recommended to set it as an environment variable named `NEBIUS_API_KEY` rather than passing it directly in code for security reasons.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Refer to the `langchain-nebius` GitHub repository or PyPI page for explicit `langchain-core` version requirements. Use `pip install -U langchain-nebius` to get the latest compatible version.","message":"LangChain Version Compatibility: As the LangChain ecosystem (especially `langchain-core`) evolves rapidly, ensure your installed `langchain-nebius` version is compatible with your core LangChain packages to avoid import errors or unexpected behavior.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult the official Nebius AI Studio documentation for up-to-date model names and availability. Avoid hardcoding model names if they are subject to frequent changes.","message":"Model String Variations: The `model` parameter for `ChatNebius` and `NebiusEmbeddings` expects a specific string identifier. These identifiers may vary or new models may become available. Refer to the Nebius AI Studio documentation for the most current list of supported models.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement retry mechanisms with exponential backoff for API calls. Monitor token usage and truncate input or summarize history if close to context limits. Review Nebius AI Studio's API documentation for specific rate limits and model context window sizes.","message":"Rate Limiting and Context Length: Like most LLM providers, Nebius AI Studio may impose rate limits and have maximum context window sizes for its models. Hitting these limits can lead to errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}