For the complete documentation index, see llms.txt. This page is also available as Markdown.

RAGFlow

Add AI/ML API as a model provider in RAGFlow and use it for chat, embeddings, and vision across your knowledge bases and agents.

About

RAGFlow is an open-source Retrieval-Augmented Generation (RAG) engine that pairs deep document understanding with agent capabilities. You upload documents into knowledge bases, and RAGFlow chunks, embeds, retrieves, and answers over them.

AI/ML API is a built-in model provider in RAGFlow. It shipped upstream in PR #17311 (merged July 24, 2026) and is available to users from release v0.27.0 onward — add it in Model providers with one key and use AI/ML API models across chat, embedding, and image-to-text tasks.

Quick start

1

Run RAGFlow v0.27.0 or newer

Earlier releases do not include the provider. Check your version in the RAGFlow UI or pull a current image.

2

Open Model providers

Click your avatar in the top-right corner, then open Model providers.

3

Add aimlapi.com

Find aimlapi.com under the providers to be added and click Add the LLM.

4

Fill in the model and key

Choose the model type, pick a model, paste your AI/ML API key, and save.

5

Set your system defaults

In Set default models, select the AI/ML API models RAGFlow should use for chat, embedding, and image-to-text.

When to use AI/ML API with RAGFlow

AI/ML API works well with RAGFlow when you want:

  • one key covering the chat, embedding, and vision models a RAG pipeline needs

  • to change the answering model without re-embedding your knowledge bases

  • to compare models from different vendors inside the same RAGFlow instance

Prerequisites

Before you start, make sure you have:

The base URL is:

Need a key first? Use API Key Management.

Supported model types

The provider registers three model types in RAGFlow:

RAGFlow model type
Used for

Chat

answering, agents, and assistants

Embedding

indexing documents into knowledge bases

Img2txt

reading images and scanned pages

Video, audio, and image-generation models are not exposed through this provider.

Model selection

The provider ships a short preset list, and you can add any other AI/ML API model by its exact ID.

Good starting models

  • openai/gpt-4o — chat and image-to-text

  • anthropic/claude-opus-4-8 — long-context answering

  • google/gemini-2.5-flash — lower latency and lower cost

  • openai/text-embedding-3-small — embeddings

For the full catalog, use All Model IDs.

Config checklist

Make sure these values are set:

  • provider: aimlapi.com in Model providers

  • API key: your AI/ML API key

  • base URL: https://api.aimlapi.com/v1 (built in; override with AIMLAPI_API_URL if you run through a proxy)

  • default models: set under Set default models

Troubleshooting

aimlapi.com is not in the provider list

The provider ships from RAGFlow v0.27.0. Upgrade your deployment — on v0.26.x and earlier the entry does not exist.

A model I want is not in the dropdown

The preset list is short by design. Add the model by its exact AI/ML API ID instead — the provider accepts any OpenAI-compatible chat or embedding model ID from the catalog.

I get an auth error

Check that:

Retrieval quality dropped after switching the embedding model

Changing the embedding model changes the vector space. Re-parse the affected knowledge bases so the documents are re-embedded with the new model.

Last updated

Was this helpful?