ProviderName Property  
 

Sets or returns the name of the current service provider.

Syntax

object.ProviderName [= value ]

Remarks

The ProviderName property returns a String which identifies the current provider. If no provider has been selected, this property returns an empty string. Changing this property selects the provider used for inference. This is used with the ModelName property to specify the service and model the client will use. This property cannot be changed while there is an active connection to a service provider.

Name Constant Description
Local llmProviderLocal Local inference provider, such as LM Studio or Ollama.
OpenAI llmProviderOpenAI OpenAI provider using the ChatGPT models.
Anthropic llmProviderAnthropic Anthropic provider using the Claude models.
Google llmProviderGoogle Google AI provider using the Gemini models.
Microsoft llmProviderMicrosoft Microsoft Foundry provider using OpenAI-compatible models.
Mistral llmProviderMistral Mistral AI provider using the Mistral models.

The provider names listed above are predefined values used by the control to select an internal provider definition. In some cases, applications may be able to use a compatible provider by selecting the provider whose API format it supports, and then setting the BaseUrl and ModelName properties to the appropriate values. For example, a provider which implements an OpenAI-compatible API may be used by setting this property to "OpenAI" and specifying the provider's endpoint and model name.

The ProviderName property can be used to display a human-readable provider name to a user, or as an alternative to assigning a numeric identifier to the Provider property. If the application assigns a value to this property, it is compared against an internal table of matching names to determine the appropriate provider. The comparison is not case-sensitive, and matches do not have to be exact. For example, if the string "Microsoft Foundry" were assigned to this property, it would recognize the provider as llmProviderMicrosoft.

If the specified provider name is not recognized, assigning a value to this property will fail and the control will return an invalid provider error. Assigning an empty string to this property is the same as setting the Provider property to llmProviderNone.

The ProviderName and Provider properties are reciprocal. Changing the value of one property automatically changes the value of the other.

Changing the current provider also resets the ModelName and ModelFlags properties to the default model for the selected provider, and resets the BaseUrl property to the default endpoint for that provider. Applications should always set the provider name first, and then change the model name or endpoint URL if necessary.

Setting this property to an empty string clears the values of the BaseUrl, ModelName and ModelFlags properties.

Data Type

String

Example

' Select the OpenAI provider
LlmClient1.ProviderName = "OpenAI"
LlmClient1.ModelName = "gpt-5.4-nano"
LlmClient1.ApiKey = "%OPENAI_API_KEY%"

If LlmClient1.Connect() Then
    LlmClient1.Prompt = "What is the capital of Denmark?"

    If LlmClient1.SendMessage() Then
        MsgBox LlmClient1.Response, vbInformation
    Else
        MsgBox LlmClient1.LastErrorString, vbExclamation
    End If

    LlmClient1.Disconnect
Else
    MsgBox LlmClient1.LastErrorString, vbExclamation
End If

See Also

BaseUrl Property, DefaultModel Property, IsLocal Property, ModelFlags Property, ModelName Property, ProviderFlags Property, Provider Property, Connect Method, GetProvider Method