Skip to main content

llama-index llms Nebius AI Studio integration

Project description

LlamaIndex Llms Integration: Nebius AI Studio

Overview

Integrate with Nebius AI Studio API, which provides access to open-source state-of-the-art large language models (LLMs).

Installation

pip install llama-index-llms-nebius

Usage

Initialization

With environmental variables.

NEBIUS_API_KEY=your_api_key
from llama_index.llms.nebius import NebiusLLM

llm = NebiusLLM(model="meta-llama/Meta-Llama-3.1-70B-Instruct-fast")

Without environmental variables

from llama_index.llms.nebius import NebiusLLM

llm = NebiusLLM(
    api_key="your_api_key", model="meta-llama/Meta-Llama-3.1-70B-Instruct-fast"
)

Launching

Call complete with a prompt

response = llm.complete("Amsterdam is the capital of ")
print(response)

Call chat with a list of messages

from llama_index.core.llms import ChatMessage

messages = [
    ChatMessage(role="system", content="You are a helpful AI assistant."),
    ChatMessage(
        role="user",
        content="Write a poem about a smart AI robot named Wall-e.",
    ),
]
response = llm.chat(messages)
print(response)

Stream complete

response = llm.stream_complete("Amsterdam is the capital of ")
for r in response:
    print(r.delta, end="")

Stream chat

from llama_index.core.llms import ChatMessage

messages = [
    ChatMessage(role="system", content="You are a helpful AI assistant."),
    ChatMessage(
        role="user",
        content="Write a poem about a smart AI robot named Wall-e.",
    ),
]
response = llm.stream_chat(messages)
for r in response:
    print(r.delta, end="")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_nebius-0.3.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_nebius-0.3.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_nebius-0.3.0.tar.gz.

File metadata

  • Download URL: llama_index_llms_nebius-0.3.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_nebius-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a0408036bd8aeda3128a17ebbe797ab4ce46cf66b08cbaf6e728c3ee53111dac
MD5 9d8c691ea36ea415bd89cbace2b7a370
BLAKE2b-256 f0a5f4c333fea4296f4e496b8bb82e6f374c4756b98e697fa5367ec157cf1fb4

See more details on using hashes here.

File details

Details for the file llama_index_llms_nebius-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_llms_nebius-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_nebius-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98db71123e18ef7eda1289eb58ccd1a0f902b960c67b37fa12db6ace853a215a
MD5 2142d828c8cba6375ec18eec191f341a
BLAKE2b-256 010e69d2c099691e2b93b9f0a62dbc709cfd1d14e2d924215f26a36a3e5b2a41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page