The [VPC-SC security controls](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/security-controls.md.txt) and
CMEK are supported by RAG Engine on Gemini Enterprise Agent Platform. Data residency and AXT security controls aren't
supported.

This page lists Gemini models, self-deployed models, and models with
managed APIs on Agent Platform that support RAG Engine on Gemini Enterprise Agent Platform.

## Gemini models

The following models support RAG Engine:

#### Click to expand supported models

- [Gemini 3.8 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-8-flash.md.txt)
- [Gemini 3.7 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-7-flash.md.txt)
- [Gemini 3.6 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-6-flash.md.txt)
- [Gemini 3.5 Flash-Lite](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-5-flash-lite.md.txt)
- [Gemini 3.5 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-5-flash.md.txt)
- [Gemini 3.1 Pro](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-pro.md.txt) preview
- [Gemini 3.1 Flash-Lite](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-1-flash-lite.md.txt)
- [Gemini 3 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/3-flash.md.txt) preview
- [Gemini 2.5 Pro](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/2-5-pro.md.txt)
- [Gemini 2.5 Flash-Lite](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/2-5-flash-lite.md.txt)
- [Gemini 2.5 Flash](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/2-5-flash.md.txt)

Fine-tuned Gemini models are unsupported when the Gemini
models use RAG Engine on Gemini Enterprise Agent Platform.

## Self-deployed models

RAG Engine on Gemini Enterprise Agent Platform supports all models in
[Model Garden](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-garden/explore-models.md.txt).

Use RAG Engine with your self-deployed open model endpoints.

Replace the variables used in the code sample:

- **<var translate="no">PROJECT_ID</var>**: Your project ID.
- **<var translate="no">LOCATION</var>**: The region to process your request.
- **<var translate="no">ENDPOINT_ID</var>**: Your endpoint ID.

  ```python
    # Create a model instance with your self-deployed open model endpoint
    rag_model = GenerativeModel(
        "projects/PROJECT_ID/locations/LOCATION/endpoints/ENDPOINT_ID",
        tools=[rag_retrieval_tool]
    )
  ```

## Models with managed APIs on Agent Platform

The models with managed APIs on Agent Platform that support
RAG Engine include the following:

- [Mistral on
  Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/mistral)
- [Llama 3.1 and 3.2](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/llama.md.txt)

The following code sample demonstrates how to use the Gemini
`GenerateContent` API to create a generative model instance. The model ID,
`/publisher/meta/models/llama-3.1-405B-instruct-maas`, is found in the
[model card](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-garden/explore-models.md.txt).

Replace the variables used in the code sample:

- **<var translate="no">PROJECT_ID</var>**: Your project ID.
- **<var translate="no">LOCATION</var>**: The region to process your request.
- **<var translate="no">RAG_RETRIEVAL_TOOL</var>**: Your RAG retrieval tool.

  ```python
    # Create a model instance with Llama 3.1 MaaS endpoint
    rag_model = GenerativeModel(
        "projects/PROJECT_ID/locations/LOCATION/publisher/meta/models/llama-3.1-405B-instruct-maas",
        tools=RAG_RETRIEVAL_TOOL
    )
  ```

The following code sample demonstrates how to use the OpenAI compatible
`ChatCompletions` API to generate a model response.

Replace the variables used in the code sample:

- **<var translate="no">PROJECT_ID</var>**: Your project ID.
- **<var translate="no">LOCATION</var>**: The region to process your request.
- **<var translate="no">MODEL_ID</var>** : LLM model for content generation. For example, `meta/llama-3.1-405b-instruct-maas`.
- **<var translate="no">INPUT_PROMPT</var>**: The text sent to the LLM for content generation. Use a prompt relevant to the documents in Agent Search.
- **<var translate="no">RAG_CORPUS_ID</var>**: The ID of the RAG corpus resource.
- **<var translate="no">ROLE</var>**: Your role.
- **<var translate="no">USER</var>**: Your username.
- **<var translate="no">CONTENT</var>**: Your content.

  ```python
    # Generate a response with Llama 3.1 MaaS endpoint
    response = client.chat.completions.create(
        model="MODEL_ID",
        messages=[{"ROLE": "USER", "content": "CONTENT"}],
        extra_body={
            "extra_body": {
                "google": {
                    "vertex_rag_store": {
                        "rag_resources": {
                            "rag_corpus": "RAG_CORPUS_ID"
                        },
                        "similarity_top_k": 10
                    }
                }
            }
        },
    )
  ```

## What's next

- [Use Embedding models with RAG Engine](https://docs.cloud.google.com/gemini-enterprise-agent-platform/build/rag-engine/use-embedding-models.md.txt).