Custom Provider fetch models is broken with 0.100.1
To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.
Please avoid AI slops, be concise, and focus on what matters for this issue.
Describe the bug
Fetch models with the newest version 0.100.1 doesn't work anymore. Works still with 0.99.x
My config.json content snippet
"providers": { "xyz": { "api": "openai-chat", "url": "https://api.xyz.com/llm/v1", "key": "${env:XYZ_API_KEY}", "fetchModels": true }
BR Dennis
@snoopier I can't repro that testing latest released version, also the auto fetch models was added on 0.100.0, not 0.99.0 and it's enabled by default
c/c @zikajk in case has anything on mind, but from my tests, all working
Spooky
With 0.99.0 it works fine with config above. if i remove "fetchModels": true then also no models will be load. With 0.99.0 i see in stderr
[MODELS] Provider 'xyz': Discovered 21 models from /models endpoint
thats my provider.
With 0.100.1 std_err
[MODELS] Provider 'openai': Using models.dev provider-id fallback (url 'https://api.openai.com' not matched)
[MODELS] Provider 'openai': Loaded 41 models from models.dev
[MODELS] Provider 'anthropic': Using models.dev provider-id fallback (url 'https://api.anthropic.com' not matched)
[MODELS] Provider 'anthropic': Loaded 22 models from models.dev
[MODELS] Provider 'github-copilot': Loaded 20 models from models.dev
[MODELS] Provider 'google': Using models.dev provider-id fallback (url 'https://generativelanguage.googleapis.com/v1beta/openai' not matched)
[MODELS] Provider 'google': Loaded 26 models from models.dev
My provider is not listed
@snoopier what's your provider so I can check from models.dev?
@snoopier When fetchModels is true it will try to fetch models based on api url or provider name. In your case, nothing is matching so it makes sense to just set fetchModels to false (or ignore it) and set models manually.
I removed the support for /models endpoint that was in place before because I realized that various providers might use various URLs. But if you want I can add it back to be used first (before models.dev is used).
hum, got it, not sure if it's best to have a new flag to do that or leave user configure manually, @snoopier is it a problem to manually add models to your provider with the ones you wanna use?
@ericdallo I assumed that anyone who doesn't have a provider on models.dev never uses /models, but maybe that was a mistake. Personally, I don't think there's a problem with using the same flag, because the result is similar in the end, but each provider has different logic, and models.dev is universal in this regard.
yeah makes sense, I'm ok with using the same flag
I can't post the provider :-) and yes /models is the key to fetch the models. The models changes weekly so the auto fetching is a great feature for me/us.
@snoopier I see, I am on it. Shouldn't take long ;-)
@snoopier Fixed https://github.com/editor-code-assistant/eca/pull/300
It works, thx