Skip to content

Commit 0f89dd0

Browse files
Merge pull request #472 from janhq/update-dev-from-master-2026-04-01-00-57
Sync master with upstream release b8606
2 parents eafe68a + 825eb91 commit 0f89dd0

104 files changed

Lines changed: 3081 additions & 2286 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,6 @@ indent_style = tab
2121
[prompts/*.txt]
2222
insert_final_newline = unset
2323

24-
[tools/server/public/*]
25-
indent_size = 2
26-
27-
[tools/server/public/deps_*]
28-
trim_trailing_whitespace = unset
29-
indent_style = unset
30-
indent_size = unset
31-
3224
[tools/server/deps_*]
3325
trim_trailing_whitespace = unset
3426
indent_style = unset
@@ -61,6 +53,14 @@ charset = unset
6153
trim_trailing_whitespace = unset
6254
insert_final_newline = unset
6355

56+
[tools/server/public/**]
57+
indent_style = unset
58+
indent_size = unset
59+
end_of_line = unset
60+
charset = unset
61+
trim_trailing_whitespace = unset
62+
insert_final_newline = unset
63+
6464
[benches/**]
6565
indent_style = unset
6666
indent_size = unset

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Treat the generated single-file WebUI build as binary for diff purposes.
2+
# Git's pack-file delta compression still works (byte-level), but this prevents
3+
# git diff from printing the entire minified file on every change.
4+
tools/server/public/index.html -diff

.github/workflows/build.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181
- build: 'x64'
182182
os: ubuntu-22.04
183183
- build: 'arm64'
184-
os: ubuntu-22.04-arm
184+
os: ubuntu-24.04-arm
185185
- build: 's390x'
186186
os: ubuntu-24.04-s390x
187187
- build: 'ppc64le'
@@ -207,14 +207,22 @@ jobs:
207207
run: |
208208
sudo apt-get update
209209
sudo apt-get install -y --no-install-recommends \
210-
python3 python3-pip python3-dev \
210+
python3 python3-pip python3-dev python3-wheel \
211211
libjpeg-dev build-essential libssl-dev \
212212
git-lfs
213213
214+
- name: Toolchain workaround (GCC 14)
215+
if: ${{ contains(matrix.os, 'ubuntu-24.04') }}
216+
run: |
217+
sudo apt-get install -y gcc-14 g++-14
218+
echo "CC=gcc-14" >> "$GITHUB_ENV"
219+
echo "CXX=g++-14" >> "$GITHUB_ENV"
220+
214221
- name: Python Dependencies
215222
id: python_depends
216223
run: |
217-
python3 -m pip install --upgrade pip
224+
export PIP_BREAK_SYSTEM_PACKAGES="1"
225+
python3 -m pip install --upgrade pip setuptools
218226
pip3 install ./gguf-py
219227
220228
- name: Swap Endianness
@@ -292,7 +300,15 @@ jobs:
292300
ctest -L main --verbose
293301
294302
ubuntu-24-vulkan:
295-
runs-on: ${{ 'ubuntu-24.04-arm' || 'ubuntu-24.04' }}
303+
strategy:
304+
matrix:
305+
include:
306+
- build: 'x64'
307+
os: ubuntu-24.04
308+
- build: 'arm64'
309+
os: ubuntu-24.04-arm
310+
311+
runs-on: ${{ matrix.os }}
296312

297313
steps:
298314
- name: Clone
@@ -302,7 +318,10 @@ jobs:
302318
- name: Dependencies
303319
id: depends
304320
run: |
305-
sudo apt-get install -y glslc libvulkan-dev libssl-dev ninja-build
321+
sudo apt-get update
322+
sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev libssl-dev ninja-build
323+
echo "CC=gcc-14" >> "$GITHUB_ENV"
324+
echo "CXX=g++-14" >> "$GITHUB_ENV"
306325
307326
- name: Configure
308327
id: cmake_configure

.github/workflows/release.yml

Lines changed: 40 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -131,17 +131,16 @@ jobs:
131131
path: llama-${{ steps.tag.outputs.name }}-bin-macos-x64.tar.gz
132132
name: llama-bin-macos-x64.tar.gz
133133

134-
ubuntu-22-cpu:
134+
ubuntu-cpu:
135135
strategy:
136136
matrix:
137137
include:
138138
- build: 'x64'
139139
os: ubuntu-22.04
140+
- build: 'arm64'
141+
os: ubuntu-24.04-arm
140142
- build: 's390x'
141143
os: ubuntu-24.04-s390x
142-
# GGML_BACKEND_DL and GGML_CPU_ALL_VARIANTS are not currently supported on arm
143-
# - build: 'arm64'
144-
# os: ubuntu-22.04-arm
145144

146145
runs-on: ${{ matrix.os }}
147146

@@ -165,6 +164,13 @@ jobs:
165164
sudo apt-get update
166165
sudo apt-get install build-essential libssl-dev
167166
167+
- name: Toolchain workaround (GCC 14)
168+
if: ${{ contains(matrix.os, 'ubuntu-24.04') }}
169+
run: |
170+
sudo apt-get install -y gcc-14 g++-14
171+
echo "CC=gcc-14" >> "$GITHUB_ENV"
172+
echo "CXX=g++-14" >> "$GITHUB_ENV"
173+
168174
- name: Build
169175
id: cmake_build
170176
run: |
@@ -194,8 +200,16 @@ jobs:
194200
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz
195201
name: llama-bin-ubuntu-${{ matrix.build }}.tar.gz
196202

197-
ubuntu-22-vulkan:
198-
runs-on: ubuntu-22.04
203+
ubuntu-vulkan:
204+
strategy:
205+
matrix:
206+
include:
207+
- build: 'x64'
208+
os: ubuntu-22.04
209+
- build: 'arm64'
210+
os: ubuntu-24.04-arm
211+
212+
runs-on: ${{ matrix.os }}
199213

200214
steps:
201215
- name: Clone
@@ -207,16 +221,23 @@ jobs:
207221
- name: ccache
208222
uses: ggml-org/ccache-action@v1.2.21
209223
with:
210-
key: ubuntu-22-vulkan
224+
key: ubuntu-vulkan-${{ matrix.build }}
211225
evict-old-files: 1d
212226

213227
- name: Dependencies
214228
id: depends
215229
run: |
216-
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
217-
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
218-
sudo apt-get update -y
219-
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libssl-dev
230+
if [[ "${{ matrix.os }}" =~ "ubuntu-22.04" ]]; then
231+
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add -
232+
sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list
233+
sudo apt-get update -y
234+
sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libssl-dev
235+
else
236+
sudo apt-get update -y
237+
sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev libssl-dev ninja-build
238+
echo "CC=gcc-14" >> "$GITHUB_ENV"
239+
echo "CXX=g++-14" >> "$GITHUB_ENV"
240+
fi
220241
221242
- name: Build
222243
id: cmake_build
@@ -239,13 +260,13 @@ jobs:
239260
id: pack_artifacts
240261
run: |
241262
cp LICENSE ./build/bin/
242-
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
263+
tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,./,llama-${{ steps.tag.outputs.name }}/," -C ./build/bin .
243264
244265
- name: Upload artifacts
245266
uses: actions/upload-artifact@v6
246267
with:
247-
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz
248-
name: llama-bin-ubuntu-vulkan-x64.tar.gz
268+
path: llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
269+
name: llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz
249270

250271
ubuntu-24-openvino:
251272
runs-on: ubuntu-24.04
@@ -977,8 +998,8 @@ jobs:
977998
- windows-sycl
978999
- windows-hip
9791000
- ubuntu-22-rocm
980-
- ubuntu-22-cpu
981-
- ubuntu-22-vulkan
1001+
- ubuntu-cpu
1002+
- ubuntu-vulkan
9821003
- ubuntu-24-openvino
9831004
- macOS-arm64
9841005
- macOS-x64
@@ -1061,9 +1082,11 @@ jobs:
10611082
10621083
**Linux:**
10631084
- [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz)
1085+
- [Ubuntu arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-arm64.tar.gz)
1086+
- [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz)
10641087
- [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz)
1088+
- [Ubuntu arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-arm64.tar.gz)
10651089
- [Ubuntu x64 (ROCm 7.2)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-7.2-x64.tar.gz)
1066-
- [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz)
10671090
- [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz)
10681091
10691092
**Windows:**

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
# Server Web UI temporary files
9696
/tools/server/webui/node_modules
9797
/tools/server/webui/dist
98+
# we no longer use gz for index.html
99+
/tools/server/public/index.html.gz
98100

99101
# Python
100102

common/chat.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ using chat_template_caps = jinja::caps;
221221
struct common_chat_templates {
222222
bool add_bos;
223223
bool add_eos;
224-
bool has_explicit_template; // Model had builtin template or template overridde was specified.
224+
bool has_explicit_template; // Model had builtin template or template overridden was specified.
225225
std::unique_ptr<common_chat_template> template_default; // always set (defaults to chatml)
226226
std::unique_ptr<common_chat_template> template_tool_use;
227227
};
@@ -989,6 +989,10 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp
989989
auto analysis = p.ref("analysis");
990990
auto preamble = p.rule("preamble", p.literal("<|channel|>commentary<|message|>") + p.content(content) + end);
991991
auto final_msg = p.rule("final", p.literal("<|channel|>final<|message|>") + p.content(content));
992+
993+
// Consume any unsolicited tool calls, e.g. builtin functions
994+
auto unsolicited = p.rule("unsolicited", p.atomic(p.optional(channel) + p.literal(" to=") + content + end));
995+
992996
auto any = p.rule("any", preamble | analysis);
993997

994998
if (has_response_format) {
@@ -1032,7 +1036,7 @@ static common_chat_params common_chat_params_init_gpt_oss(const common_chat_temp
10321036
return p.zero_or_more(start + any) + start + (tool_call | final_msg);
10331037
}
10341038

1035-
return p.zero_or_more(start + any) + start + final_msg;
1039+
return p.zero_or_more(start + any) + start + (final_msg | unsolicited);
10361040
});
10371041

10381042
data.parser = parser.save();

common/common.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,11 @@ bool parse_cpu_mask(const std::string & mask, bool (&boolmask)[GGML_MAX_N_THREAD
359359
}
360360

361361
void common_init() {
362+
#if defined(_WIN32)
363+
SetConsoleOutputCP(CP_UTF8);
364+
SetConsoleCP(CP_UTF8);
365+
#endif
366+
362367
llama_log_set(common_log_default_callback, NULL);
363368

364369
#ifdef NDEBUG
@@ -367,7 +372,7 @@ void common_init() {
367372
const char * build_type = " (debug)";
368373
#endif
369374

370-
LOG_INF("build: %d (%s) with %s for %s%s\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT, LLAMA_COMPILER, LLAMA_BUILD_TARGET, build_type);
375+
LOG_DBG("build: %d (%s) with %s for %s%s\n", LLAMA_BUILD_NUMBER, LLAMA_COMMIT, LLAMA_COMPILER, LLAMA_BUILD_TARGET, build_type);
371376
}
372377

373378
std::string common_params_get_system_info(const common_params & params) {
@@ -1243,6 +1248,9 @@ llama_context * common_init_result::context() {
12431248
}
12441249

12451250
common_sampler * common_init_result::sampler(llama_seq_id seq_id) {
1251+
if (seq_id < 0 || seq_id >= (int) pimpl->samplers.size()) {
1252+
return nullptr;
1253+
}
12461254
return pimpl->samplers[seq_id].get();
12471255
}
12481256

0 commit comments

Comments
 (0)