> ## 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.

# Chat2Graph

> Learn how to configure Chat2Graph with LiteLLM environment variables and connect graph-native agent workflows to ScitiX Model Inference.

[Chat2Graph](https://github.com/TuGraph-family/chat2graph) is an open-source graph-native agent system from the TuGraph family. It calls large language models through LiteLLM, and `LLM_ENDPOINT` can point to any OpenAI-compatible service, so you can connect Chat2Graph to ScitiX Model Inference.

This guide uses `glm-5.2` as an example. For the full model list and pricing, see [Models](https://console.scitix.ai/model-inference/models).

## Configure

Create an API Key on the [API Keys](https://console.scitix.ai/model-inference/api_keys) page. Copy `.env.template` to `.env`, then fill in:

```bash theme={null}
MODEL_PLATFORM_TYPE=LITELLM
LLM_NAME=openai/glm-5.2
LLM_ENDPOINT=https://api.scitix.ai/model-api/v1
LLM_APIKEY=<YOUR_API_KEY>

EMBEDDING_MODEL_NAME=Qwen/Qwen3-Embedding-4B
EMBEDDING_MODEL_ENDPOINT=https://api.scitix.ai/model-api/v1/embeddings
EMBEDDING_MODEL_APIKEY=<YOUR_API_KEY>
```

| Field                      | Description                                                                                                                                    |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| `MODEL_PLATFORM_TYPE`      | Set to `LITELLM`.                                                                                                                              |
| `LLM_NAME`                 | Use `openai/<model-id>` so LiteLLM treats the model as OpenAI-compatible and routes requests through `LLM_ENDPOINT`, such as `openai/glm-5.2`. |
| `LLM_ENDPOINT`             | ScitiX OpenAI-compatible base URL with `/v1`: `https://api.scitix.ai/model-api/v1`                                                             |
| `LLM_APIKEY`               | Your API Key created on the [API Keys](https://console.scitix.ai/model-inference/api_keys) page                                                |
| `EMBEDDING_MODEL_ENDPOINT` | ScitiX embedding endpoint: `https://api.scitix.ai/model-api/v1/embeddings`                                                                     |

## Verify

Build and start Chat2Graph with `./bin/build.sh` and `./bin/start.sh`, open the Web UI at the default `http://localhost:5010/`, and send a message. A normal reply confirms that the connection works.

You can also run a minimal LiteLLM check with the same configuration:

```python theme={null}
import litellm

r = litellm.completion(
    model="openai/glm-5.2",
    api_base="https://api.scitix.ai/model-api/v1",
    api_key="<YOUR_API_KEY>",
    messages=[{"role": "user", "content": "Reply with exactly: OK"}],
)
print(r.choices[0].message.content)
```

## FAQ

* **`LLM_NAME` must include the `openai/` prefix**:
  This tells LiteLLM to treat the model as an OpenAI-compatible provider and use `LLM_ENDPOINT` instead of trying to infer another provider.
* **`LLM_ENDPOINT` is a base URL with `/v1`**:
  Use `https://api.scitix.ai/model-api/v1`. The embedding endpoint uses the full `/v1/embeddings` path.
* **Model IDs**:
  Use model IDs from the [Models](https://console.scitix.ai/model-inference/models) page.
