All Products
Search
Document Center

PolarDB:AI_ModelCacheLists

Last Updated:Mar 28, 2026

Returns the count and names of all models currently loaded in the model cache.

Syntax

AI_ModelCacheLists()

Return values

Returns a string that describes the number of cached models and lists their names.

Sample output:

model cache count 1, cache list is : ai_model_cache1;

Description

AI_ModelCacheLists queries the model cache and lists every model that has been loaded into memory. Use this function to check which models are available for inference, audit resource usage, and identify cached models that are no longer needed.

Examples

The following example calls an AI model and then verifies it appears in the cache.

  1. Use AI_CallModel to call an AI model:

    SELECT polar_ai.ai_callmodel('ai_model_cache1', '风急天高猿啸哀'::text);
  2. List the currently cached models:

    SELECT polar_ai.AI_ModelCacheLists();

    Expected output:

    model cache count 1, cache list is : ai_model_cache1;