跳转到主要内容
AnythingLLM lets you configure LLM and embedding providers independently. Both support the Generic OpenAI option, which is how you connect Qhaigc. You need to complete both sections for a working RAG pipeline — the LLM handles chat, and the embedding provider indexes your documents.

Prerequisites

  • Access to an AnythingLLM desktop app or self-hosted instance
  • A Qhaigc API key — get yours from the API Tokens page

Step 1: Configure the LLM Provider

1

Open LLM Preference settings

In AnythingLLM, go to Settings and find LLM Preference.
2

Select Generic OpenAI

From the LLM provider list, select Generic OpenAI.
3

Fill in the LLM fields

Enter the following values:
FieldValue
Base URLhttps://api.qhaigc.net/v1
API KeyYour Qhaigc API key (starts with sk-)
Chat Model NameThe model you want to use (e.g. gpt-4o)
Model context windowThe context window size for your chosen model
Max TokensThe maximum output token limit
Save the configuration.

Step 2: Configure the Embedding Provider

1

Open Embedding Preference settings

Still in Settings, find the Embedding Preference section.
2

Select Generic OpenAI

Choose Generic OpenAI as the embedding provider.
3

Fill in the embedding fields

Enter the following values:
FieldValue
Base URLhttps://api.qhaigc.net/v1
API KeyYour Qhaigc API key (if the field is shown)
Embedding ModelThe embedding model to use (e.g. bge-m3 or text-embedding-3-large)
Save the configuration.

Step 3: Test the Setup

1

Run a connection test

Use the built-in connection test (if available) to confirm both configurations save correctly.
2

Create a workspace and upload a document

Create a new workspace, upload a document, and send a chat message that references the document content. A successful answer confirms both the LLM and embedding pipeline are working.

Verify the Connection

  • The LLM configuration saves without error.
  • The embedding configuration saves without error.
  • You can upload a document to a workspace and receive accurate, document-grounded answers in chat.
AnythingLLM separates Model context window (the model’s total context length) from Max Tokens (the maximum number of output tokens). These are distinct fields — do not enter the same value in both.

Troubleshooting

LLM or embedding configuration fails to save. Check that the Base URL, API key, and model name are all entered correctly. RAG answers are inaccurate or empty. If the LLM works but document context is missing, confirm that the embedding configuration is also saved and pointing to a valid embedding model.