AIN. - AnythingLLM AI

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

AIN. - AnythingLLM AI

AIN.GetModel

Previous Top Next


MiniRobotLanguage (MRL)

 

AIN.GetModel
Get the Currently Set Model

 

Intention

 

GetModel Command: Retrieve the Active AI Model
 
The GetModel command fetches the identifier or details of the currently set AI model in the AnythingLLM system.

This is useful for verifying or debugging the model used for chat or other operations.

It’s part of the AIN - AnythingLLM AI suite.

 

What is the GetModel Command?

 

This command returns the name or identifier of the AI model currently configured for use in AnythingLLM, such as an OpenAI model or a custom one.

The result can be stored in a variable or on the stack for further processing.

 

Why Do You Need It?

 

Retrieving the current model is useful for:

Verification: Confirm which model is active before executing chats.

Debugging: Troubleshoot issues related to model-specific behavior.

Automation: Adjust scripts based on the active model.

 

How to Use the GetModel Command?

 

Call the command with an optional parameter to store the model identifier.

It does not require an API call but retrieves the model set via prior configuration (e.g., AIN.SetKey or workspace settings).

 

Example Usage

 

AIN.GetModel|$$MOD

DBP.Current Model: $$MOD

 

This stores the current model identifier in $$MOD.

 

Illustration

 

┌───────────────┐

│ Model         │

├───────────────┤

│ "gpt-3.5"     │

└───────────────┘

Retrieving the active model identifier.

 

Syntax

 

AIN.GetModel[|P1]

AIN.GEM[|P1]

 

Parameter Explanation

 

P1 - (Optional) Variable to store the model identifier; if omitted, the result is stored on the stack.

 

Example

 

AIN.GEM|$$MOD

DBP.Active Model: $$MOD

ENR.

 

Remarks

 

- Returns the model set globally or for the current workspace context.

- Does not fetch model details from the API; reflects the local configuration.

 

Limitations

 

- Limited to 1 parameter; excess parameters trigger an error.

- Returns an empty string if no model is set.

 

See also:

 

AIN.ExecuteOpenAIChat

AIN.SetKey

AIN.GetWorkspaceBySlug