This commit is contained in:
Timothy Jaeryang Baek
2026-06-29 02:43:14 -05:00
parent 2414dfca70
commit 2bdd2ab94e
4 changed files with 114 additions and 26 deletions
+38 -2
View File
@@ -90,6 +90,37 @@ export const getModelTags = async (token: string = '') => {
return res;
};
export const getBaseModelTags = async (token: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/models/base/tags`, {
method: 'GET',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
authorization: `Bearer ${token}`
}
})
.then(async (res) => {
if (!res.ok) throw await res.json();
return res.json();
})
.then((json) => {
return json;
})
.catch((err) => {
error = err;
console.error(err);
return null;
});
if (error) {
throw error;
}
return res;
};
export const importModels = async (token: string, models: object[]) => {
let error = null;
@@ -118,10 +149,15 @@ export const importModels = async (token: string, models: object[]) => {
return res;
};
export const getBaseModels = async (token: string = '') => {
export const getBaseModels = async (token: string = '', tag: string = '') => {
let error = null;
const res = await fetch(`${WEBUI_API_BASE_URL}/models/base`, {
const searchParams = new URLSearchParams();
if (tag) {
searchParams.append('tag', tag);
}
const res = await fetch(`${WEBUI_API_BASE_URL}/models/base?${searchParams.toString()}`, {
method: 'GET',
headers: {
Accept: 'application/json',