fix(model_info_view.tsx): call db for model info

This commit is contained in:
Krrish Dholakia 2025-03-14 17:44:45 -07:00
parent 8bf395f9d0
commit bee72d03c6
2 changed files with 66 additions and 23 deletions

View file

@ -1254,6 +1254,36 @@ export const modelInfoCall = async (
}
};
export const modelInfoV1Call = async (accessToken: String, modelId: String) => {
/**
* Get all models on proxy
*/
try {
let url = proxyBaseUrl ? `${proxyBaseUrl}/v1/model/info` : `/v1/model/info`;
url += `?litellm_model_id=${modelId}`;
const response = await fetch(url, {
method: "GET",
headers: {
[globalLitellmHeaderName]: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
});
if (!response.ok) {
const errorData = await response.text();
throw new Error("Network response was not ok");
}
const data = await response.json();
console.log("modelInfoV1Call:", data);
return data;
} catch (error) {
console.error("Failed to create key:", error);
throw error;
}
};
export const modelHubCall = async (accessToken: String) => {
/**
* Get all models on proxy