AI GatewayIntegrations

LlamaIndex Integration

Use the CoreValue LLM for LlamaIndex to route OpenAI-compatible requests through the CoreValue AI Gateway with full observability.

Introduction

The CoreValue LLM for LlamaIndex lets you send OpenAI‑compatible requests through the CoreValue AI Gateway — no provider keys needed. Gain centralized routing, observability, and control across many models and providers.

This integration uses a dedicated LlamaIndex package: llama-index-llms-corevalue.

Install

pip install llama-index-llms-corevalue

Usage

from llama_index.llms.corevalue import CoreValue
from llama_index.llms.openai_like.base import ChatMessage

llm = CoreValue(
    api_key="<corevalue-api-key>",
    model="gpt-4o-mini",  # works across providers
    is_chat_model=True,
)

message: ChatMessage = ChatMessage(role="user", content="Hello world!")

response = llm.chat(messages=[message])
print(str(response))

Parameters

  • model: OpenAI‑compatible model name routed via CoreValue. See the model registry.
  • api_base (optional): Base URL for CoreValue AI Gateway (defaults to the package’s DEFAULT_API_BASE). Can also be set via COVA_API_BASE.
  • api_key: Your CoreValue API key. You can set via constructor or COVA_API_KEY.
  • default_headers (optional): Add additional headers; the Authorization: Bearer <api_key> header is set automatically.

Environment Variables

export COVA_API_KEY=sk-cova-XXXXXXXXXXXXXXXX
# Optional override
export COVA_API_BASE=https://gateway.corevalue.dev/v1

Advanced Configuration

from llama_index.llms.corevalue import CoreValue

llm = CoreValue(
    model="gpt-4.1-mini",
    api_key="<corevalue-api-key>",
    api_base="https://gateway.corevalue.dev/v1",
    default_headers={
        "Cova-Session-Id": "demo-session",
        "Cova-User-Id": "user-123",
        "Cova-Property-Environment": "production",
    },
    temperature=0.2,
    max_tokens=256,
)

While you're here, why not give us a star on GitHub? It helps us a lot!

Notes

  • Authentication uses your CoreValue API key; provider keys are not required when using the AI Gateway.
  • All requests appear in the CoreValue dashboard with full request/response visibility and cost tracking.
  • Learn more about routing and model coverage:

Request a CoreValue Integration

Looking for a framework or tool not listed here? Request it here!

On this page