${sanitizeResponseContent(
- JSON.stringify(message.info.usage, null, 2)
- .replace(/"([^(")"]+)":/g, '$1:')
- .slice(1, -1)
- .split('\n')
- .map((line) => line.slice(2))
- .map((line) => (line.endsWith(',') ? line.slice(0, -1) : line))
- .join('\n')
- )}`
- : `prompt_tokens: ${message.info.prompt_tokens ?? 'N/A'}
- completion_tokens: ${message.info.completion_tokens ?? 'N/A'}
- total_tokens: ${message.info.total_tokens ?? 'N/A'}`
- : `response_token/s: ${
- `${
- Math.round(
- ((message.info.eval_count ?? 0) /
- ((message.info.eval_duration ?? 0) / 1000000000)) *
- 100
- ) / 100
- } tokens` ?? 'N/A'
- }
- prompt_token/s: ${
- Math.round(
- ((message.info.prompt_eval_count ?? 0) /
- ((message.info.prompt_eval_duration ?? 0) / 1000000000)) *
- 100
- ) / 100 ?? 'N/A'
- } tokens
- total_duration: ${
- Math.round(((message.info.total_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A'
- }ms
- load_duration: ${
- Math.round(((message.info.load_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A'
- }ms
- prompt_eval_count: ${message.info.prompt_eval_count ?? 'N/A'}
- prompt_eval_duration: ${
- Math.round(((message.info.prompt_eval_duration ?? 0) / 1000000) * 100) / 100 ??
- 'N/A'
- }ms
- eval_count: ${message.info.eval_count ?? 'N/A'}
- eval_duration: ${
- Math.round(((message.info.eval_duration ?? 0) / 1000000) * 100) / 100 ?? 'N/A'
- }ms
- approximate_total: ${approximateToHumanReadable(message.info.total_duration ?? 0)}`}
- placement="top"
+ content={message.usage
+ ? `${sanitizeResponseContent(
+ JSON.stringify(message.usage, null, 2)
+ .replace(/"([^(")"]+)":/g, '$1:')
+ .slice(1, -1)
+ .split('\n')
+ .map((line) => line.slice(2))
+ .map((line) => (line.endsWith(',') ? line.slice(0, -1) : line))
+ .join('\n')
+ )}
`
+ : ''}
+ placement="bottom"
>
-
-
+
+
+
{/if}
diff --git a/src/lib/constants.ts b/src/lib/constants.ts
index 700bd3c42..d92f33671 100644
--- a/src/lib/constants.ts
+++ b/src/lib/constants.ts
@@ -9,9 +9,9 @@ export const WEBUI_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1`;
export const OLLAMA_API_BASE_URL = `${WEBUI_BASE_URL}/ollama`;
export const OPENAI_API_BASE_URL = `${WEBUI_BASE_URL}/openai`;
-export const AUDIO_API_BASE_URL = `${WEBUI_BASE_URL}/audio/api/v1`;
-export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/images/api/v1`;
-export const RETRIEVAL_API_BASE_URL = `${WEBUI_BASE_URL}/retrieval/api/v1`;
+export const AUDIO_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/audio`;
+export const IMAGES_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/images`;
+export const RETRIEVAL_API_BASE_URL = `${WEBUI_BASE_URL}/api/v1/retrieval`;
export const WEBUI_VERSION = APP_VERSION;
export const WEBUI_BUILD_HASH = APP_BUILD_HASH;