Compare commits

..
6 Commits
Author SHA1 Message Date
Aleksander GrygierandGitHub 3e3a7a416d ui: show generation statistics by default in chat settings (#26624) 2026-08-05 11:03:23 +02:00
Niklas WenzelandGitHub d52ec04a66 build : remove GGML_METAL_USE_BF16 from all build scripts (#26604) 2026-08-05 10:44:34 +02:00
Aleksander GrygierandGitHub e031d95679 ui: Update vulnerable packages + cleanup Storybook config (#26607)
* chore: Upgrade Storybook

* chore: Bump package-lock

* chore: bump vitest to 4.1.10

* ui: bump fast-uri to 3.1.5

* ui: bump ip-address to 10.4.0

* ui: bump js-yaml to 4.3.1

* ui: bump immutable to 5.1.9

* ui: bump postcss to 8.5.25

* ui: bump brace-expansion to safe versions

* ui: bump sharp to 0.35.3 via override

* ui: bump body-parser to 2.3.0

* ui: bump vite to 7.3.6 and esbuild to 0.28.1

Assisted-by: Claude Sonnet

* ui: bump hono to 4.13.0

* ui: bump dompurify to 3.4.13

* ui: bump @sveltejs/kit to 2.70.2

* ui: bump @modelcontextprotocol/sdk to 1.30.0

* ui: bump valibot to 1.4.2 via override

* chore: Remove legacy setup file

* refactor: Nits cleanup
2026-08-05 08:06:37 +02:00
Evan HuusandGitHub 6ea215d171 Prefer npm ci over install for security (#26601) 2026-08-05 00:14:22 +02:00
PascalandGitHub 4308a4f035 server: decode Windows OEM output to UTF-8 in built-in tools (#26597)
a child process writes in the OEM code page, which is not UTF-8 on a
western Windows install, so accented output reaches the JSON layer as
invalid bytes and gets replaced there, silently losing the characters

run() spawns without a console, so the child never inherits the console
code page and GetOEMCP is the one that applies

decode with MB_ERR_INVALID_CHARS so a wrong code page returns the text
untouched instead of emitting replacement characters, and pass text that
already decodes as UTF-8 through so a child emitting UTF-8 is never
decoded twice

the check drops an incomplete trailing sequence before validating, since
a streamed chunk can end in the middle of a multi-byte character
2026-08-04 22:24:55 +02:00
Abhinay KrishnaandGitHub 474c92e722 mtmd: correcting duplicate empty audio chunks for short inputs (#26536)
* correcting duplicate empty audio chunks for short inputs

* tests.sh code restored
2026-08-04 22:05:56 +02:00
16 changed files with 964 additions and 650 deletions
-5
View File
@@ -60,7 +60,6 @@ jobs:
-DCMAKE_BUILD_RPATH="@loader_path" \
-DLLAMA_FATAL_WARNINGS=ON \
-DLLAMA_BUILD_BORINGSSL=ON \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=OFF \
-DGGML_METAL_SHADER_DEBUG=ON \
-DGGML_RPC=ON \
@@ -127,7 +126,6 @@ jobs:
run: |
sysctl -a
cmake -B build -G Xcode \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DLLAMA_OPENSSL=OFF \
-DLLAMA_BUILD_APP=OFF \
@@ -178,7 +176,6 @@ jobs:
run: |
sysctl -a
cmake -B build -G Xcode \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DLLAMA_BUILD_COMMON=OFF \
-DLLAMA_BUILD_APP=OFF \
@@ -212,7 +209,6 @@ jobs:
run: |
sysctl -a
cmake -B build -G Xcode \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DLLAMA_BUILD_COMMON=OFF \
-DLLAMA_BUILD_APP=OFF \
@@ -257,7 +253,6 @@ jobs:
run: |
sysctl -a
cmake -B build -G Xcode \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DLLAMA_OPENSSL=OFF \
-DLLAMA_BUILD_APP=OFF \
+2 -3
View File
@@ -93,13 +93,13 @@ jobs:
- build: 'arm64'
arch: 'arm64'
os: macos-26
defines: "-DGGML_METAL_USE_BF16=ON -DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3"
defines: "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3"
# TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23780)
# in order to enable it again, we have to provision dedicated runners to run it
#- build: 'arm64-kleidiai'
# arch: 'arm64'
# os: macos-14
# defines: "-DGGML_METAL_USE_BF16=ON -DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DGGML_CPU_KLEIDIAI=ON"
# defines: "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DGGML_CPU_KLEIDIAI=ON"
- build: 'x64'
arch: 'x64'
os: macos-15-intel
@@ -1402,7 +1402,6 @@ jobs:
run: |
sysctl -a
cmake -B build -G Xcode \
-DGGML_METAL_USE_BF16=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DLLAMA_OPENSSL=OFF \
-DLLAMA_BUILD_APP=OFF \
-2
View File
@@ -17,7 +17,6 @@ LLAMA_BUILD_MTMD=ON
GGML_METAL=ON
GGML_METAL_EMBED_LIBRARY=ON
GGML_BLAS_DEFAULT=ON
GGML_METAL_USE_BF16=ON
GGML_OPENMP=OFF
COMMON_C_FLAGS="-Wno-macro-redefined -Wno-shorten-64-to-32 -Wno-unused-command-line-argument -g"
@@ -44,7 +43,6 @@ COMMON_CMAKE_ARGS=(
-DGGML_METAL_EMBED_LIBRARY=${GGML_METAL_EMBED_LIBRARY}
-DGGML_BLAS_DEFAULT=${GGML_BLAS_DEFAULT}
-DGGML_METAL=${GGML_METAL}
-DGGML_METAL_USE_BF16=${GGML_METAL_USE_BF16}
-DGGML_NATIVE=OFF
-DGGML_OPENMP=${GGML_OPENMP}
)
+3 -3
View File
@@ -123,15 +123,15 @@ function(npm_build out_var)
endif()
if(need_install)
message(STATUS "UI: running npm install")
message(STATUS "UI: running npm ci")
execute_process(
COMMAND ${NPM_EXECUTABLE} install
COMMAND ${NPM_EXECUTABLE} ci
WORKING_DIRECTORY "${WORK_DIR}"
RESULT_VARIABLE rc
ERROR_VARIABLE err
)
if(NOT rc EQUAL 0)
message(STATUS "UI: npm install failed (${rc})")
message(STATUS "UI: npm ci failed (${rc})")
message(STATUS " stderr: ${err}")
return()
endif()
+2 -4
View File
@@ -556,10 +556,8 @@ bool mtmd_audio_preprocessor_whisper::preprocess(const float * s
}
std::vector<float> smpl;
// if input is too short, pad with zeros
// this is to avoid potential issues with stage1/2 padding in log_mel_spectrogram
// TODO: maybe handle this better
size_t min_samples = (size_t) hparams.audio_sample_rate * (hparams.audio_chunk_len + 1); // +1 second margin
// reflection padding needs one sample plus half an FFT window
size_t min_samples = (size_t) hparams.audio_n_fft / 2 + 1;
if (n_samples < min_samples) {
smpl.resize(min_samples, 0.0f);
std::memcpy(smpl.data(), samples, n_samples * sizeof(float));
+51 -3
View File
@@ -17,12 +17,60 @@
#include <functional>
#include <memory>
#if defined(_WIN32)
# ifndef NOMINMAX
# define NOMINMAX
# endif
# include <windows.h>
#endif
namespace fs = std::filesystem;
//
// internal helpers
//
#if defined(_WIN32)
// A chunk can end in the middle of a multi-byte sequence, so the incomplete
// tail is dropped before validating what precedes it.
static bool is_utf8_text(const std::string & text) {
return is_valid_utf8(text.substr(0, validate_utf8(text)));
}
// A child process writes its output in the OEM code page, which is not UTF-8
// on a western Windows install, so accented text reaches the JSON layer as
// invalid bytes and is replaced there. Text that already decodes as UTF-8 is
// returned untouched, so a child that emits UTF-8 is never decoded twice.
// run() spawns without a console, so the console code page does not apply.
static std::string console_output_to_utf8(const std::string & text) {
if (text.empty() || is_utf8_text(text)) {
return text;
}
const UINT cp = GetOEMCP();
// fail rather than emit replacement characters when the code page is wrong
const int wide_len = MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, text.data(), (int) text.size(), nullptr, 0);
if (wide_len <= 0) {
return text;
}
std::wstring wide(wide_len, L'\0');
MultiByteToWideChar(cp, MB_ERR_INVALID_CHARS, text.data(), (int) text.size(), wide.data(), wide_len);
const int utf8_len = WideCharToMultiByte(CP_UTF8, 0, wide.data(), wide_len, nullptr, 0, nullptr, nullptr);
if (utf8_len <= 0) {
return text;
}
std::string utf8(utf8_len, '\0');
WideCharToMultiByte(CP_UTF8, 0, wide.data(), wide_len, utf8.data(), utf8_len, nullptr, nullptr);
return utf8;
}
#else
static std::string console_output_to_utf8(const std::string & text) {
return text;
}
#endif
json server_tool::to_json() const {
return {
{"display_name", display_name},
@@ -246,14 +294,14 @@ public:
size_t len = strlen(buf);
if (output.size() + len <= max_output) {
output.append(buf, len);
if (on_chunk && !on_chunk(std::string(buf, len))) {
if (on_chunk && !on_chunk(console_output_to_utf8(std::string(buf, len)))) {
proc.terminate();
break;
}
} else {
size_t remaining = max_output - output.size();
output.append(buf, remaining);
if (on_chunk && remaining > 0) on_chunk(std::string(buf, remaining));
if (on_chunk && remaining > 0) on_chunk(console_output_to_utf8(std::string(buf, remaining)));
truncated = true;
}
}
@@ -267,7 +315,7 @@ public:
res.exit_code = proc.join();
res.output = output;
res.output = console_output_to_utf8(output);
res.timed_out = timed_out.load();
if (truncated) {
res.output += "\n[output truncated]";
+2 -1
View File
@@ -11,7 +11,8 @@ const config: StorybookConfig = {
'@chromatic-com/storybook',
'@storybook/addon-vitest',
'@storybook/addon-a11y',
'@storybook/addon-docs'
'@storybook/addon-docs',
'@storybook/addon-mcp'
],
framework: '@storybook/sveltekit',
viteFinal: async (config) => {
-12
View File
@@ -1,12 +0,0 @@
import * as a11yAddonAnnotations from '@storybook/addon-a11y/preview';
import { setProjectAnnotations } from '@storybook/sveltekit';
import * as previewAnnotations from './preview';
import { beforeAll } from 'vitest';
const project = setProjectAnnotations([a11yAddonAnnotations, previewAnnotations]);
beforeAll(async () => {
if (project.beforeAll) {
await project.beforeAll();
}
});
+1 -1
View File
@@ -89,7 +89,7 @@ Llama UI supports two server operation modes:
```bash
cd tools/ui
npm install
npm ci
```
### 2. Start llama-server
+877 -592
View File
File diff suppressed because it is too large Load Diff
+21 -18
View File
@@ -27,20 +27,20 @@
"cleanup": "rm -rf .svelte-kit build node_modules test-results dist dev-dist debug-storybook.log static/pwa-*.png static/maskable-icon-*.png static/apple-touch-icon-*.png static/apple-splash-*.png static/favicon*.ico"
},
"devDependencies": {
"@chromatic-com/storybook": "5.0.0",
"@chromatic-com/storybook": "5.2.1",
"@eslint/compat": "1.4.1",
"@eslint/js": "9.39.2",
"@internationalized/date": "3.12.2",
"@lucide/svelte": "1.25.0",
"@modelcontextprotocol/sdk": "1.26.0",
"@modelcontextprotocol/sdk": "1.30.0",
"@playwright/test": "1.56.1",
"@storybook/addon-a11y": "10.2.4",
"@storybook/addon-docs": "10.2.4",
"@storybook/addon-svelte-csf": "5.0.10",
"@storybook/addon-vitest": "10.2.4",
"@storybook/sveltekit": "10.2.4",
"@storybook/addon-a11y": "10.5.6",
"@storybook/addon-docs": "10.5.6",
"@storybook/addon-svelte-csf": "5.1.2",
"@storybook/addon-vitest": "10.5.6",
"@storybook/sveltekit": "10.5.6",
"@sveltejs/adapter-static": "3.0.10",
"@sveltejs/kit": "2.60.1",
"@sveltejs/kit": "2.70.2",
"@sveltejs/vite-plugin-svelte": "6.2.1",
"@tailwindcss/forms": "0.5.10",
"@tailwindcss/typography": "0.5.16",
@@ -48,16 +48,16 @@
"@types/node": "24.13.0",
"@vite-pwa/assets-generator": "1.0.2",
"@vite-pwa/sveltekit": "1.1.0",
"@vitest/browser": "4.1.8",
"@vitest/browser-playwright": "4.1.8",
"@vitest/coverage-v8": "4.1.8",
"@vitest/browser": "4.1.10",
"@vitest/browser-playwright": "4.1.10",
"@vitest/coverage-v8": "4.1.10",
"bits-ui": "2.18.1",
"clsx": "2.1.1",
"dexie": "4.4.3",
"dompurify": "3.4.11",
"dompurify": "3.4.13",
"eslint": "9.39.4",
"eslint-config-prettier": "10.1.8",
"eslint-plugin-storybook": "10.4.2",
"eslint-plugin-storybook": "10.5.6",
"eslint-plugin-svelte": "3.19.0",
"fflate": "0.8.3",
"globals": "16.5.0",
@@ -82,7 +82,7 @@
"remark-math": "6.0.0",
"remark-rehype": "11.1.2",
"sass": "1.100.0",
"storybook": "10.4.2",
"storybook": "10.5.6",
"svelte": "5.56.1",
"svelte-check": "4.6.0",
"svelte-sonner": "1.1.1",
@@ -95,13 +95,16 @@
"unified": "11.0.5",
"unist-util-visit": "5.1.0",
"uuid": "13.0.2",
"vite": "7.3.5",
"vite": "7.3.6",
"vite-plugin-devtools-json": "0.2.1",
"vitest": "4.1.8",
"vitest": "4.1.10",
"vitest-browser-svelte": "2.1.1",
"workbox-window": "7.4.1"
"workbox-window": "7.4.1",
"@storybook/addon-mcp": "0.7.0"
},
"overrides": {
"cookie": "1.1.1"
"cookie": "1.1.1",
"sharp": "0.35.3",
"valibot": "1.4.2"
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ cd ../../
# Ensure node_modules are installed
if [ ! -d "tools/ui/node_modules" ]; then
echo "📦 Installing npm dependencies..."
cd tools/ui && npm install && cd ../../
cd tools/ui && npm ci && cd ../../
fi
# Check and install git hooks if missing
+1 -1
View File
@@ -14,7 +14,7 @@ cd "$REPO_ROOT/tools/ui"
# Check that node_modules exists
if [ ! -d "node_modules" ]; then
echo "❌ node_modules not found. Run 'npm install' first."
echo "❌ node_modules not found. Run 'npm ci' first."
exit 1
fi
+1 -1
View File
@@ -30,7 +30,7 @@ cd "$REPO_ROOT/tools/ui"
# Check that node_modules exists
if [ ! -d "node_modules" ]; then
echo "❌ node_modules not found. Run 'npm install' first."
echo "❌ node_modules not found. Run 'npm ci' first."
exit 1
fi
@@ -198,7 +198,7 @@ const SETTINGS_REGISTRY: Record<string, SettingsSectionEntry> = {
key: SETTINGS_KEYS.SHOW_MESSAGE_STATS,
label: 'Show message generation statistics',
help: 'Display generation statistics (tokens/second, token count, duration) below each assistant message.',
defaultValue: false,
defaultValue: true,
type: SettingsFieldType.CHECKBOX,
section: SETTINGS_SECTION_SLUGS.DISPLAY
},
+1 -2
View File
@@ -76,8 +76,7 @@ export default defineConfig({
extends: './vite.config.ts',
test: {
name: 'ui',
browser: { ...browserBaseConfig, instances: [{ browser: 'chromium', headless: true }] },
setupFiles: ['./.storybook/vitest.setup.ts']
browser: { ...browserBaseConfig, instances: [{ browser: 'chromium', headless: true }] }
},
plugins: [
storybookTest({