You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm testing out the experimental "provider registry" and I've found if the model ID has a : in it, this package will remove everything before the LAST :, which sends the wrong model ID to the LLM API.
Code example
I'm using the OpenAI provider in compatible mode, to allow me to run ollama.
constmodelID='phi3:medium'constconfig={apiKey: '',organization: '',baseURL: 'http://localhost:11434/v1',// Running ollama locally.compatibility: 'compatible',// In 'compatible' mode to use local ollama model.}constproviderRegistry=createProviderRegistry({openai: createOpenAI(config),})// Provider registry expects `openai:` if the openai provider is being used.const{ text }=awaitgenerateText({model: this.providerRegistry.languageModel(`openai:${modelID}`}),// Result: openai:phi3:medium// Additional options omitted})
This will error, because the request to ollama has the model ID, medium, not phi3:medium. Could the registry use the FIRST colon to extract the provider ID, instead of the LAST colon?
Additional context
Alternatively, I can just run
constmodelID='phi3:medium'constconfig={apiKey: '',organization: '',baseURL: 'http://localhost:11434/v1',// Running ollama locally.compatibility: 'compatible',// In 'compatible' mode to use local ollama model.}constprovider=createOpenAI(config)const{ text }=awaitgenerateText({model: provider.languageModel(modelID),// Additional options omitted})
and this works fine. So, it's definitely a problem with how the registry decides which provider to use.
The text was updated successfully, but these errors were encountered:
Description
I'm testing out the experimental "provider registry" and I've found if the model ID has a
:
in it, this package will remove everything before the LAST:
, which sends the wrong model ID to the LLM API.Code example
I'm using the
OpenAI
provider incompatible
mode, to allow me to run ollama.This will error, because the request to ollama has the model ID,
medium
, notphi3:medium
. Could the registry use the FIRST colon to extract the provider ID, instead of the LAST colon?Additional context
Alternatively, I can just run
and this works fine. So, it's definitely a problem with how the registry decides which provider to use.
The text was updated successfully, but these errors were encountered: