forked from open-webui/open-webui
		
	feat: external model info
This commit is contained in:
		
							parent
							
								
									eb004ccfc2
								
							
						
					
					
						commit
						32cb5f3ceb
					
				
					 3 changed files with 27 additions and 21 deletions
				
			
		|  | @ -33,7 +33,7 @@ export const getLiteLLMModels = async (token: string = '') => { | |||
| 					id: model.id, | ||||
| 					name: model.name ?? model.id, | ||||
| 					external: true, | ||||
| 					source: 'litellm' | ||||
| 					source: 'LiteLLM' | ||||
| 				})) | ||||
| 				.sort((a, b) => { | ||||
| 					return a.name.localeCompare(b.name); | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ | |||
| 
 | ||||
| 	import { user, MODEL_DOWNLOAD_POOL, models } from '$lib/stores'; | ||||
| 	import { toast } from 'svelte-sonner'; | ||||
| 	import { getModels, splitStream } from '$lib/utils'; | ||||
| 	import { capitalizeFirstLetter, getModels, splitStream } from '$lib/utils'; | ||||
| 	import Tooltip from '$lib/components/common/Tooltip.svelte'; | ||||
| 
 | ||||
| 	const i18n = getContext('i18n'); | ||||
|  | @ -225,6 +225,7 @@ | |||
| 							</div> | ||||
| 
 | ||||
| 							{#if item.info.external} | ||||
| 								<Tooltip content={item.info?.source ?? 'External'}> | ||||
| 									<div class=" mr-2"> | ||||
| 										<svg | ||||
| 											xmlns="http://www.w3.org/2000/svg" | ||||
|  | @ -244,6 +245,7 @@ | |||
| 											/> | ||||
| 										</svg> | ||||
| 									</div> | ||||
| 								</Tooltip> | ||||
| 							{/if} | ||||
| 						</div> | ||||
| 
 | ||||
|  |  | |||
|  | @ -31,6 +31,10 @@ export const getModels = async (token: string) => { | |||
| // Helper functions
 | ||||
| //////////////////////////
 | ||||
| 
 | ||||
| export const capitalizeFirstLetter = (string) => { | ||||
| 	return string.charAt(0).toUpperCase() + string.slice(1); | ||||
| }; | ||||
| 
 | ||||
| export const splitStream = (splitOn) => { | ||||
| 	let buffer = ''; | ||||
| 	return new TransformStream({ | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek