Skip to main content

llama-index llms ovhcloud integration

Project description

LlamaIndex Llms Integration: OVHcloud AI Endpoints

This integration allows you to use OVHcloud AI Endpoints with LlamaIndex. OVHcloud AI Endpoints provides OpenAI-compatible API endpoints for various models.

OVHcloud is a global player and the leading European cloud provider operating over 450,000 servers within 40 data centers across 4 continents to reach 1.6 million customers in over 140 countries. Our product AI Endpoints offers access to various models with sovereignty, data privacy and GDPR compliance.

Installation

Install the required packages:

pip install llama-index llama-index-llms-ovhcloud

API Key

OVHcloud AI Endpoints can be used in two ways:

  1. Free tier (with rate limits): You can use the API without an API key or with an empty string API key. This provides free access with rate limits.

  2. With API key: For higher rate limits and production use, generate an API key from the OVHcloud manager:

    • Go to https://ovh.com/manager
    • Navigate to Public Cloud section
    • Go to AI & Machine Learning → AI Endpoints
    • Create an API key

Usage

Basic Usage

To use OVHcloud AI Endpoints with LlamaIndex, first initialize the LLM:

from llama_index.llms.ovhcloud import OVHcloud

# Using with API key
llm = OVHcloud(
    model="gpt-oss-120b",
    api_key="YOUR_API_KEY",  # Or empty string for free tier with rate limits)
)

You can find available models in the OVHcloud AI Endpoints catalog.

Basic Completion

Generate a simple completion:

response = llm.complete("The capital of France is")
print(response.text)

Chat Messages

Use chat-style interactions:

from llama_index.core.llms import ChatMessage

messages = [
    ChatMessage(role="system", content="You are a helpful assistant"),
    ChatMessage(role="user", content="What is the capital of France?"),
]
response = llm.chat(messages)
print(response)

Streaming

Stream completions in real-time:

# Streaming completion
response = llm.stream_complete("The capital of France is")
for r in response:
    print(r.delta, end="")

# Streaming chat
messages = [
    ChatMessage(role="system", content="You are a helpful assistant"),
    ChatMessage(role="user", content="What is the capital of France?"),
]
response = llm.stream_chat(messages)
for r in response:
    print(r.delta, end="")

Get Available Models

You can dynamically fetch available models:

llm = OVHcloud(model="gpt-oss-120b")
available = llm.available_models  # List[Model] - fetched dynamically
model_ids = [model.id for model in available]
print(f"Available models: {model_ids}")

Additional Resources

For more information about OVHcloud AI Endpoints, visit:

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_ovhcloud-0.1.0.tar.gz (6.1 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_ovhcloud-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_ovhcloud-0.1.0.tar.gz.

File metadata

  • Download URL: llama_index_llms_ovhcloud-0.1.0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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_ovhcloud-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c7266bd9f3fa50122f91b87b051d5913a44bf80aec8f6a6e64fc4b96f859e36f
MD5 3382c9dd9c439988a67ab95849993c28
BLAKE2b-256 62c401944c5d3d051eb0cb87f0cdec18f698865e835187002b7b9597d585037c

See more details on using hashes here.

File details

Details for the file llama_index_llms_ovhcloud-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_llms_ovhcloud-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"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_ovhcloud-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36af461a3f21b40aa00645021ae413c711b91fa14ffd0ec9e25c04a834d8970f
MD5 a2854d602bc350a5578a73a018666499
BLAKE2b-256 bfff20f687d9d61ecd1ef2c00960bf404090ac59e4eac7042c45e8e3ae91523d

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