# LlamaIndex

Connect → LlamaIndex

# Use AxForge with LlamaIndex

    LlamaIndex connects models to your data:
    indexes, retrieval, agents. Its `OpenAILike` class is made for OpenAI-compatible services such as
    AxForge.

    **Before you start**

        - An AxForge API key, in the environment variable `AXFORGE_API_KEY`.
        Get one (a minute).

        - Python 3.10 or newer. Run with llama-index-llms-openai-like 0.8.1 (llama-index-core 0.14.25) on
        2026-10-17.

## Set it up

### Install the OpenAILike package

```
pip install llama-index-llms-openai-like
```

### Point OpenAILike at AxForge

```
import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(
    api_base="https://api.axforge.ai/v1",
    api_key=os.environ["AXFORGE_API_KEY"],
    model="qwen3.8-27b-nvfp4",
    is_chat_model=True,
    is_function_calling_model=True,
    context_window=262144,
)
print(llm.complete("Say hello in five words"))
```

`OpenAILike` cannot ask our models what they can do, so you tell it: they are chat models,
        they call tools, and they read 262,144 tokens at once.

### Run it

```
python hello.py
```

To use it everywhere in LlamaIndex: `from llama_index.core import Settings`, then
    `Settings.llm = llm`.

## The settings

        | Argument | Value |  |

        | api_base | https://api.axforge.ai/v1 |  |

        | api_key | your AxForge key |  |

        | model | qwen3.8-27b-nvfp4, glm-5.3-flash or mimo-v2.6-flash |  |

        | is_chat_model · is_function_calling_model | True · True |  |

        | context_window | 262144 |  |

Which model for what: `qwen3.8-27b-nvfp4` is the
    everyday default and reads images, `glm-5.3-flash` thinks before it answers,
    `mimo-v2.6-flash` is the fastest.

## Check that it works

    The script prints an answer. The call shows in the console under
    API Keys → Recent calls within a minute.

## When it does not work

      | What you see | What it means | Fix |  |

        | `AuthenticationError`, 401 "Invalid API key. Create one at https://console.axforge.ai/keys." | the key was refused | check `AXFORGE_API_KEY` holds the whole key, or make a new one |  |

        | `KeyError: 'AXFORGE_API_KEY'` | the variable is not set in this terminal | set it as on Get your API key |  |

    Test a call says in one click whether a problem is your key,
    your balance or us.

      &larr; LangChain
      aider &rarr;



Source: https://dev.axforge.ai/docs/connect/llamaindex/
