Use openai compatible as vendor

This commit is contained in:
Xin Wang
2026-02-12 18:44:55 +08:00
parent 260ff621bf
commit ff3a03b1ad
23 changed files with 822 additions and 905 deletions

View File

@@ -13,7 +13,7 @@ const maskApiKey = (key?: string) => {
export const LLMLibraryPage: React.FC = () => {
const [models, setModels] = useState<LLMModel[]>([]);
const [searchTerm, setSearchTerm] = useState('');
const [vendorFilter, setVendorFilter] = useState<string>('all');
const [vendorFilter, setVendorFilter] = useState<string>('OpenAI Compatible');
const [typeFilter, setTypeFilter] = useState<string>('all');
const [isAddModalOpen, setIsAddModalOpen] = useState(false);
const [editingModel, setEditingModel] = useState<LLMModel | null>(null);
@@ -41,7 +41,7 @@ export const LLMLibraryPage: React.FC = () => {
m.name.toLowerCase().includes(q) ||
(m.modelName || '').toLowerCase().includes(q) ||
(m.baseUrl || '').toLowerCase().includes(q);
const matchesVendor = vendorFilter === 'all' || m.vendor === vendorFilter;
const matchesVendor = m.vendor === vendorFilter;
const matchesType = typeFilter === 'all' || m.type === typeFilter;
return matchesSearch && matchesVendor && matchesType;
});
@@ -64,8 +64,6 @@ export const LLMLibraryPage: React.FC = () => {
setModels((prev) => prev.filter((item) => item.id !== id));
};
const vendorOptions = Array.from(new Set(models.map((m) => m.vendor).filter(Boolean)));
return (
<div className="space-y-6 animate-in fade-in py-4 pb-10">
<div className="flex items-center justify-between">
@@ -92,10 +90,7 @@ export const LLMLibraryPage: React.FC = () => {
value={vendorFilter}
onChange={(e) => setVendorFilter(e.target.value)}
>
<option value="all"></option>
{vendorOptions.map((vendor) => (
<option key={vendor} value={vendor}>{vendor}</option>
))}
<option value="OpenAI Compatible">OpenAI Compatible</option>
</select>
</div>
<div className="flex items-center space-x-2">
@@ -284,8 +279,6 @@ const LLMModelModal: React.FC<{
onChange={(e) => setVendor(e.target.value)}
>
<option value="OpenAI Compatible">OpenAI Compatible</option>
<option value="OpenAI">OpenAI</option>
<option value="SiliconFlow">SiliconFlow</option>
</select>
</div>