All Products
Search
Document Center

PolarDB:AI_ModelCacheLists

Last Updated:Mar 28, 2026

Returns the count and names of all models currently cached in the system.

Syntax

text AI_ModelCacheLists()

Return values

Returns a text string listing the number of cached models and their names.

Example output:

model cache count 1, cache list is : ai_model_cache1;

Description

AI_ModelCacheLists queries the model cache in the polar_ai schema. Use this function to inspect which models are currently cached — useful for diagnosing performance issues or optimizing resource usage.

Examples

The following example calls an AI model using AI_CallModel, then queries the cache to confirm the model is loaded.

  1. Call an AI model to populate the cache.

    SELECT polar_ai.ai_callmodel('ai_model_cache1', 'The wind is swift, the sky is high, the gibbons cry is mournful'::text);
  2. View the currently cached models.

    SELECT polar_ai.AI_ModelCacheLists();

    The output is similar to:

    model cache count 1, cache list is : ai_model_cache1;