20738f3623
Replace the legacy React UI with the new Svelte-based one. Introduce a Playground in the UI to quickly test out text, image, text to speech and speech to text models behind llama-swap.
Key Changes
New Svelte UI (ui-svelte/)
- Multi-tab Playground with Chat, Image Generation, Audio Transcription, and Speech interfaces
- Chat: message editing/regeneration, markdown rendering with LaTeX math support, image attachments, code syntax highlighting
- Image: size selector, download/fullscreen viewing
- Audio: transcription with peer support
- Speech: voice caching with manual refresh, download button
- Responsive mobile layout with collapsible navigation
- XSS fixes and accessibility improvements
Proxy Improvements
- Add gzip/brotli compression for UI static assets (proxy/ui_compress.go)
- Add GET /v1/audio/voices?model={model} endpoint for voice listing
- Add peer support for /v1/audio/transcriptions
38 lines
959 B
TypeScript
38 lines
959 B
TypeScript
import { defineConfig } from "vite";
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte";
|
|
import tailwindcss from "@tailwindcss/vite";
|
|
import { compression } from "vite-plugin-compression2";
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
svelte(),
|
|
tailwindcss(),
|
|
compression({
|
|
algorithm: "gzip",
|
|
exclude: [/\.(br)$/, /\.(gz)$/],
|
|
threshold: 1024,
|
|
}),
|
|
compression({
|
|
algorithm: "brotliCompress",
|
|
exclude: [/\.(br)$/, /\.(gz)$/],
|
|
threshold: 1024,
|
|
filename: "[path][base].br",
|
|
}),
|
|
],
|
|
base: "/ui/",
|
|
build: {
|
|
outDir: "../proxy/ui_dist",
|
|
assetsDir: "assets",
|
|
},
|
|
server: {
|
|
proxy: {
|
|
"/api": "http://localhost:8080", // Proxy API calls to Go backend during development
|
|
"/logs": "http://localhost:8080",
|
|
"/upstream": "http://localhost:8080",
|
|
"/unload": "http://localhost:8080",
|
|
"/v1": "http://localhost:8080",
|
|
},
|
|
},
|
|
});
|