Hide free models from model selection

Filter out models with $0 pricing on both prompt and completion
so they don't appear in the model picker. The server still returns
them for other clients that may want to use them.
This commit is contained in:
lemon committed 2026-04-27 09:34:25 -07:00
1 parent 7e93367b5f
commit a175af8354
1 file changed
+5 -2
+5 -2
View File
@@ -130,8 +130,11 @@ export function useProviderModels(): ModelFetchResult {
// Wait for all provider requests to complete
const providerResults = await Promise.all(providerPromises);
// Flatten all models into a single array
const allModels = providerResults.flat();
// Flatten all models into a single array, excluding free models
const allModels = providerResults.flat().filter((m) => {
if (m.pricing && m.pricing.prompt.isZero() && m.pricing.completion.isZero()) return false;
return true;
});
// Set error state if there were any errors
if (errors.length > 0) {