mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-03 07:57:22 +00:00
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:
1 parent
7e93367b5f
commit
a175af8354
1 file changed
+5
-2
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user