GetProvider Method  
 

The GetProvider method returns information about the specified service provider.

Syntax

object.GetProvider( Provider, [Name], [BaseUrl], [DefaultModel], [Flags], )

Parameters

Provider
Specifies the service provider. This parameter must be one of the llmProvider constants and cannot be zero. If the provider identifier is invalid, the method will fail. For more information about providers, see the Remarks section below.
Name
An optional String parameter passed by reference. When the method returns, this will contain a canonical version of the provider's name, such as "OpenAI". This String value may be used for identification or display in the user interface. If this information is not required, the parameter may be omitted.
BaseUrl
An optional String parameter passed by reference. When the method returns, this will contain the default base URL endpoint used to issue requests to the service provider. If the provider does not have a default endpoint, this string will be empty and the application will be required to provide a base URL when establishing a connection. If this information is not required, the parameter may be omitted.
DefaultModel
An optional String parameter passed by reference. When the method returns, this will contain the name of the default model used for inference. Not all providers have a default model, and in this case an empty string will be returned. If a provider does not have a default model, a model name must be provided when establishing a connection. If this information is not required, the parameter may be omitted.
Flags
An optional Integer passed by reference. When the method returns, this parameter will specify one or more bitflags that describe the requirements and capabilities of the provider. If this information is not required, the parameter may be omitted.
Constant Value Description
llmProviderFlagNone 0 No provider requirements specified
llmProviderFlagRequireTls &H0001 Requires a secure TLS (HTTPS) connection
llmProviderFlagRequireAuth &H0002 Requires authentication (e.g., API key or token)
llmProviderFlagApiVersion &H0004 Requires an explicit API version parameter
llmProviderFlagLocal &H0008 Locally hosted provider (LM Studio, Ollama, etc.)
llmProviderFlagModelList &H0010 Supports enumerating available models
llmProviderFlagModelInfo &H0020 Supports retrieving detailed model information

Return Value

A value of True is returned if the method succeeds. If the Provider parameter is invalid, the method will return False and the LastError property will contain the error code.

Remarks

The GetProvider method returns general information about a provider, including its name, default base URL endpoint, default model, and related configuration values.

The ProviderId parameter specifies the numeric identifier assigned to a supported provider. Provider identifiers are predefined constants built into the control and are assigned fixed values beginning at 1 and increasing sequentially for each provider. These identifiers are stable and are intended to uniquely identify a provider regardless of its display name. Applications should use the predefined constants (such as llmProviderOpenAI or llmProviderMicrosoft) rather than hard-coding numeric values directly in source code.

Refer to the providers page for a list of supported service providers and their default models.

This method does not require an active client session and can be used to query provider information before connecting to a provider. The information returned by this method describes the provider defaults defined by the control. A client session may use different values if the application overrides the base URL, model name or settings.

Example

Private Sub Form_Load()
    Dim nProviderId As Long
    Dim strProvider As String

    ComboProviders.Clear

    ' Enumerate through all the supported providers. The local
    ' provider is always the first available service provider.
    nProviderId = llmProviderLocal

    Do While LlmClient1.GetProvider(nProviderId, strProvider)
        ComboProviders.AddItem strProvider

        ' Store the provider ID with the item
        ComboProviders.ItemData(ComboProviders.NewIndex) = nProviderId

        nProviderId = nProviderId + 1
    Loop

    ' Select the first provider by default
    If ComboProviders.ListCount > 0 Then
        ComboProviders.ListIndex = 0
    End If
End Sub

See Also

BaseUrl Property, DefaultModel Property, Provider Property, ProviderName Property