Files
zoeissleeping 57e7a92cd1 fix: UI polish and provider fixes
- Add animate-pulse CSS animation for loading states
- Add Ctrl+I/Ctrl+B markdown shortcuts in chat input
- Improve chat input resize with mirror element
- Add reasoning duration display and shimmer effect
- Add confirmation dialog for deleting all models
- Simplify RowVirtualizerDynamic resize handling
- Fix DialogType imports (type -> value)
- Fix ollama cloud model name resolution
- Make vllm auth header optional
- Various icon and styling fixes
2026-05-11 17:44:00 -05:00

43 lines
1.2 KiB
TypeScript

import { Ok } from '~~/types/result';
import type { ProviderModule } from '.';
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
export default {
id: 'vllm',
baseUrl: '',
modelsEndpoint: '/models',
createGateway({ apiKey, baseURL }) {
return Ok({
gateway: createOpenAICompatible({ name: 'vLLM', apiKey, baseURL, includeUsage: true }),
streamTransformer: undefined,
textTransformer: undefined,
});
},
getAuthHeaders(apiKey) {
return apiKey ? { Authorization: `Bearer ${apiKey}` } : {};
},
async fetchModels({ baseURL, apiKey }) {
const res = await fetch(`${baseURL}/models`, {
method: 'GET',
headers: apiKey ? { Authorization: `Bearer ${apiKey}` } : {},
});
const data = await res.json();
if (!res.ok) {
throw createError({ statusCode: res.status, message: JSON.stringify(data) });
}
return data.data.map((model: any) => ({
id: model.id,
attributes: {
inputModalities: ['text'],
outputModalities: ['text'],
contextWindow: model.max_model_len,
}
}));
},
} satisfies ProviderModule;