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

# Llama-Index Agent

> Llama-Index Agent + Nebius Token Factory

LlamaAgents helps you build, serve and deploy small, workflow‑driven agentic apps using LlamaIndex

[Llama-index agent docs](https://developers.llamaindex.ai/python/llamaagents/overview/)

## Prerequisites

1. [Create an API key](https://tokenfactory.nebius.com/project/api-keys) to authorize requests to Nebius Token Factory.
2. Save the API key into a `NEBIUS_API_KEY` environment variable:

   ```shellscript theme={null}
   export NEBIUS_API_KEY="<API_key>"
   ```
3. Install the `llama-index` package

   ```shellscript theme={null}
   pip install llama-index  llama-index-llms-nebius
   ```

## Quickstart

```python theme={null}
from llama_index.core.tools import FunctionTool
from llama_index.llms.openai import OpenAI
from llama_index.core.agent.workflow import ReActAgent, FunctionAgent
from llama_index.llms.nebius import NebiusLLM

# define sample Tool
def multiply(a: int, b: int) -> int:
    """Multiply two integers and returns the result integer"""
    return a * b

llm = NebiusLLM(
    model="Qwen/Qwen3-30B-A3B",
    api_key=os.getenv("NEBIUS_API_KEY")
)

# initialize agent
agent = FunctionAgent(
    tools=[multiply],
    system_prompt="You are an agent that can invoke a tool for multiplication when assisting a user.",
)
```

## More Examples

View [more examples](https://github.com/nebius/token-factory-cookbook/blob/main/agents/README.md#llama-index) in our cookbook.
