> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scitix.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LlamaIndex

> Learn how to use LlamaIndex with ScitiX Model Inference for RAG, agents, and OpenAI-compatible model access.

[LlamaIndex](https://github.com/run-llama/llama_index) is a leading data framework for RAG and agents. Its `OpenAILike` LLM class targets any OpenAI-compatible endpoint, so it runs on the ScitiX Model Inference API.

Default model here is `glm-5.2`; see the [Models](https://console.scitix.ai/model-inference/models) page for the full list and pricing.

## Configure

Create an API key on the ScitiX [API Keys](https://console.scitix.ai/model-inference/api_keys) page and export it:

```bash theme={null}
export SCITIX_API_KEY="<Your API Key>"
```

Install `llama-index-llms-openai-like` and build an `OpenAILike` LLM:

```python theme={null}
import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    model="glm-5.2",
    api_base="https://api.scitix.ai/model-api/v1",
    api_key=os.environ["SCITIX_API_KEY"],
    is_chat_model=True,
)
```

| Field           | Description                                                             |
| --------------- | ----------------------------------------------------------------------- |
| `model`         | ScitiX model ID, e.g. `glm-5.2`                                         |
| `api_base`      | ScitiX OpenAI-compatible endpoint: `https://api.scitix.ai/model-api/v1` |
| `api_key`       | Your ScitiX API key, read from the environment                          |
| `is_chat_model` | Set `True` so LlamaIndex uses the chat-completions API                  |

Use `OpenAILike`, not `OpenAI`. The plain `OpenAI` class validates model IDs against OpenAI's own list and rejects ScitiX model IDs.

For embeddings/RAG, add a ScitiX embedding model, e.g. `Qwen/Qwen3-Embedding-8B`, via the matching LlamaIndex embedding integration.

## Verify

Call the model — a normal reply confirms the connection (verified on **llama-index-core 0.14.23**, `llama-index-llms-openai-like` 0.7.2):

```python theme={null}
print(llm.complete("In one short sentence, which model are you?"))
# → I am GLM, a large language model developed by Z.ai.
```
