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

# Use in DB-GPT

> Integrate AnyFast AI models with DB-GPT — the open-source AI native data app framework.

## 1. About DB-GPT

[DB-GPT](https://github.com/eosphoros-ai/DB-GPT) is an open-source AI Native Data App Development framework. It provides multi-model management, Text2SQL optimization, RAG framework, and Multi-Agent collaboration capabilities.

## 2. Get an API Key

Open the [AnyFast console](https://www.anyfast.ai/) and sign up (or log in). Go to **API Keys**, create a new API Key, and copy it.

## 3. Deploy DB-GPT

### 3.1 Clone DB-GPT

```bash theme={null}
git clone https://github.com/eosphoros-ai/DB-GPT.git
cd DB-GPT
```

### 3.2 Create virtual environment and install dependencies

```bash theme={null}
conda create -n dbgpt_env python=3.10
conda activate dbgpt_env
pip install -e ".[proxy]"
```

### 3.3 Configure environment variables

```bash theme={null}
cp .env.template .env
```

Edit `.env` and configure AnyFast models:

```ini theme={null}
# Use AnyFast as the proxy model provider
LLM_MODEL=proxy_openai
PROXY_OPENAI_API_BASE=https://www.anyfast.ai/v1
PROXY_OPENAI_API_KEY={your-anyfast-api-key}
PROXY_OPENAI_BACKEND=gpt-4o

# Embedding model (OpenAI-compatible)
EMBEDDING_MODEL=proxy_http_openapi
PROXY_HTTP_OPENAPI_PROXY_SERVER_URL=https://www.anyfast.ai/v1/embeddings
PROXY_HTTP_OPENAPI_PROXY_API_KEY={your-anyfast-api-key}
PROXY_HTTP_OPENAPI_PROXY_BACKEND=text-embedding-3-small
```

### 3.4 Start DB-GPT

```bash theme={null}
dbgpt start webserver --port 5670
```

Open [http://127.0.0.1:5670/](http://127.0.0.1:5670/) in your browser.

## 4. Using AnyFast via DB-GPT Python SDK

### 4.1 Install

```bash theme={null}
pip install "dbgpt>=0.6.3rc2" openai
```

### 4.2 Use AnyFast language model

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="{your-anyfast-api-key}",
    base_url="https://www.anyfast.ai/v1"
)

response = client.chat.completions.create(
    model="gpt-4o",
    messages=[
        {"role": "system", "content": "You are a helpful AI assistant."},
        {"role": "user", "content": "Hello"}
    ]
)
print(response.choices[0].message.content)
```

## 5. Getting Started

1. **Add a data source** — Select a database type (MySQL, PostgreSQL, etc.) and connect.
2. **Choose ChatData mode** — Use the natural language-to-data conversation feature.
3. **Start data conversations** — Select the AnyFast model and your database, then start chatting with your data.

<script src="/feedback.js" />
