Sets or returns the identifier for the current service provider.
Syntax
object.Provider [= value ]
Remarks
The Provider property returns a numeric identifier for the
current provider. If no provider has been selected, this property returns
zero. 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.
| Constant |
Value |
Description |
| llmProviderNone |
0 |
No provider specified. |
| llmProviderLocal |
1 |
Local inference provider, such as LM Studio or Ollama. |
| llmProviderOpenAI |
2 |
OpenAI provider using the ChatGPT models. |
| llmProviderAnthropic |
3 |
Anthropic provider using the Claude models. |
| llmProviderGoogle |
4 |
Google AI provider using the Gemini models. |
| llmProviderMicrosoft |
5 |
Microsoft Azure AI Foundry provider using OpenAI-compatible models. |
| llmProviderMistral |
6 |
Mistral AI provider using the Mistral models. |
The provider identifiers 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
selecting llmProviderOpenAI and specifying the provider's
endpoint and model name.
The Provider and ProviderName 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 identifier first, and then change the model name or endpoint
URL if necessary.
Setting this property to llmProviderNone clears the
values of the BaseUrl, ModelName and
ModelFlags properties.
Data Type
Integer (Int32)
Example
LlmClient1.Provider = llmProviderOpenAI
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,
ProviderName Property,
Connect Method,
GetProvider Method
|