ui fix - load litellm model list

This commit is contained in:
Ishaan Jaff 2024-07-06 10:12:14 -07:00
parent 4eda3c6a1f
commit fd43ddfa0e

View file

@ -12,11 +12,19 @@ export interface Model {
model_info: Object | null; model_info: Object | null;
} }
export const modelCostMap = async () => { export const modelCostMap = async (
accessToken: string,
) => {
try { try {
const url = proxyBaseUrl ? `${proxyBaseUrl}/get/litellm_model_cost_map` : `/get/litellm_model_cost_map`; const url = proxyBaseUrl ? `${proxyBaseUrl}/get/litellm_model_cost_map` : `/get/litellm_model_cost_map`;
const response = await fetch( const response = await fetch(
url url, {
method: "GET",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
}
); );
const jsonData = await response.json(); const jsonData = await response.json();
console.log(`received litellm model cost data: ${jsonData}`); console.log(`received litellm model cost data: ${jsonData}`);