LlamaIndex with Muapi

Use LlamaIndex's OpenAILike adapter to call Muapi text models through the OpenAI-compatible chat-completions endpoint.

Install

pip install llama-index-core llama-index-llms-openai-like
export MUAPI_API_KEY="your-key"

Configure the LLM

Choose a text model ID from https://api.muapi.ai/v1/models?type=text:

import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="qwen-3-8-27b-obliterated",
    api_base="https://api.muapi.ai/v1",
    api_key=os.environ["MUAPI_API_KEY"],
    is_chat_model=True,
    is_function_calling_model=True,
)

response = llm.complete("Summarize the purpose of a vector index in one sentence.")
print(response)

Set is_function_calling_model=True only when the selected model has capabilities.tools: true in Muapi's text model list. For a model without tool calling, set it to False and use it for completion/chat tasks that do not require function calls.

Notes

  • api_base is https://api.muapi.ai/v1; do not include /chat/completions.
  • This integration exposes Muapi chat models. It does not configure embeddings; choose a separate embedding provider for retrieval pipelines.
  • Check the model's context and maximum output limits before sending large indexed contexts.

See the LlamaIndex OpenAILike docs for adapter options.