Framework

LlamaIndex

RAG and agents, European inference.

Point `OpenAILike` and `OpenAILikeEmbedding` at our base URL. Indexes, query engines, and agents: every LlamaIndex pattern, on European infrastructure.

Python
from llama_index.core import Settings
from llama_index.llms.openai_like import OpenAILike
from llama_index.embeddings.openai_like import OpenAILikeEmbedding

Settings.llm = OpenAILike(
    model=class="s">"glm-5.1",
    api_base=class="s">"https://api.melious.ai/v1",
    api_key=class="s">"sk-mel-<YOUR_API_KEY>",
    is_chat_model=True,
    is_function_calling_model=True,
)

Settings.embed_model = OpenAILikeEmbedding(
    model_name=class="s">"bge-m3",
    api_base=class="s">"https://api.melious.ai/v1",
    api_key=class="s">"sk-mel-<YOUR_API_KEY>",
)
About

What is LlamaIndex?

LlamaIndex is a Python and TypeScript framework focused on retrieval and structured data for LLM apps. Indexes, query engines, and agents, connected by a global Settings object. The OpenAILike client and OpenAILikeEmbedding companion are the first-party way to point the whole pipeline at a Chat Completions endpoint with a custom base URL.

Visit the official site llamaindex.ai
Setup

How to use LlamaIndex with Melious?

  1. Install LlamaIndex

    Install the core package plus the openai-like LLM and embedding adapters. They speak Chat Completions, which is what Melious serves.

    Shell
    pip install llama-index llama-index-llms-openai-like llama-index-embeddings-openai-like
    export MELIOUS_API_KEY=sk-mel-<YOUR_API_KEY>
  2. Configure the global Settings

    Set Settings.llm and Settings.embed_model once. Every index, query engine, and agent reads from these by default. is_chat_model=True and is_function_calling_model=True are required for agent workflows.

    Python
    import os
    from llama_index.core import Settings
    from llama_index.llms.openai_like import OpenAILike
    from llama_index.embeddings.openai_like import OpenAILikeEmbedding
    
    Settings.llm = OpenAILike(
        model=class="s">"glm-5.1",
        api_base=class="s">"https://api.melious.ai/v1",
        api_key=os.environ[class="s">"MELIOUS_API_KEY"],
        is_chat_model=True,
        is_function_calling_model=True,
    )
    
    Settings.embed_model = OpenAILikeEmbedding(
        model_name=class="s">"bge-m3",
        api_base=class="s">"https://api.melious.ai/v1",
        api_key=os.environ[class="s">"MELIOUS_API_KEY"],
    )
  3. Index and query

    Load documents, build a vector index, query it. Both the embedding pass and the completion call route through Melious. For agents, use FunctionAgent from llama_index.core.agent.workflow, the current LlamaIndex API.

    Python
    from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
    
    documents = SimpleDirectoryReader(class="s">"./docs").load_data()
    index = VectorStoreIndex.from_documents(documents)
    
    query_engine = index.as_query_engine()
    response = query_engine.query(class="s">"What does the onboarding flow do?")
    print(response)
Ready?

Three steps from here.

Grab a Melious key. Pick your tool. Follow the guide. Same client, now answering from Europe.