Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

feat(llamacpp): upgrade the engine to 0.5.0 (b11146) (#9094)

Akarshan Biswasde1e21c78986
diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock
index 3b33bd7e8..5261bfa6f 100644
--- a/src-tauri/Cargo.lock
+++ b/src-tauri/Cargo.lock
@@ -7832,7 +7832,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-llamacpp"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"base64 0.22.1",
"byteorder",
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.lock b/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.lock
index 0e54a8c70..2db46ceaf 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.lock
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.lock
@@ -3421,7 +3421,7 @@ dependencies = [
[[package]]
name = "tauri-plugin-llamacpp"
-version = "0.4.1"
+version = "0.5.0"
dependencies = [
"base64 0.22.1",
"byteorder",
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml b/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml
index 43aefe424..61b639f7a 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "tauri-plugin-llamacpp"
-version = "0.4.1"
+version = "0.5.0"
authors = ["Jan <[email protected]>"]
description = "Tauri plugin for managing Jan LlamaCpp server processes and model loading"
license = "MIT"
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/build.rs b/src-tauri/plugins/tauri-plugin-llamacpp/build.rs
index e6093399b..5bb709f9f 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/build.rs
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/build.rs
@@ -13,10 +13,10 @@
// vendor/llama.cpp and with engine::PINNED_* on the Rust side; the shim
// re-exports llama_version()/llama_build_number() so a mismatch is caught at
// runtime instead of producing a silently wrong engine.
-pub const LLAMA_CPP_TAG: &str = "b10964";
-pub const LLAMA_CPP_BUILD_NUMBER: u32 = 10964;
-pub const LLAMA_CPP_COMMIT: &str = "b29c606e28a01b1bc8c1351026a0fa6e616bf6c4";
-pub const LLAMA_CPP_VERSION: &str = "0.4.1";
+pub const LLAMA_CPP_TAG: &str = "b11146";
+pub const LLAMA_CPP_BUILD_NUMBER: u32 = 11146;
+pub const LLAMA_CPP_COMMIT: &str = "7fe450e19305b828c199d602c23a8337aaa1f03b";
+pub const LLAMA_CPP_VERSION: &str = "0.5.0";
const COMMANDS: &[&str] = &[
// Cleanup command
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
index b081d391f..92ff0e948 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/guest-js/types.ts
@@ -23,9 +23,9 @@ export interface EngineInfo {
/** Mirrors `engine::commands::EngineVersion`. */
export interface EngineVersion {
- /** llama.cpp's own version, e.g. "0.4.1". */
+ /** llama.cpp's own version, e.g. "0.5.0". */
version: string
- /** Upstream build tag the source was taken from, e.g. "b10964". */
+ /** Upstream build tag the source was taken from, e.g. "b11146". */
tag: string
/** The tag's build number, as a string. */
build_number: string
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/package.json b/src-tauri/plugins/tauri-plugin-llamacpp/package.json
index 5fead7f4f..6ce5faefb 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/package.json
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/package.json
@@ -1,6 +1,6 @@
{
"name": "@janhq/tauri-plugin-llamacpp-api",
- "version": "0.4.1",
+ "version": "0.5.0",
"private": true,
"description": "",
"type": "module",
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.cpp b/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.cpp
index 621e6ae35..e63708735 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.cpp
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.cpp
@@ -433,7 +433,7 @@ namespace {
jan_llama_engine * finish_start(std::unique_ptr<jan_llama_engine> engine,
char * err, size_t err_len) {
try {
- // server.cpp:152-157, in llama-server's main() -- which neither entry
+ // server.cpp:156-161, in llama-server's main() -- which neither entry
// point here goes through. n_parallel = -1 is the SERVER default, and
// server_context loops `for (i = 0; i < n_parallel; i++)` to build its
// slots, so leaving the sentinel unresolved yields an engine with no
@@ -443,7 +443,7 @@ jan_llama_engine * finish_start(std::unique_ptr<jan_llama_engine> engine,
engine->params.kv_unified = true;
}
- // server.cpp:160-170, immediately after the block above and dependent on
+ // server.cpp:164-174, immediately after the block above and dependent on
// it: the pool is n_parallel wide, so it can only be sized once the
// sentinel is resolved. Only `-c 0` (size to the model's trained
// context) leaves n_ctx at 0 for this to act on; any explicit ctx-size
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.h b/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.h
index 8c54f1452..0190e7bba 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.h
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/shim/jan_llama_shim.h
@@ -96,8 +96,8 @@ void jan_llama_string_free(char * s);
// The llama.cpp the shim was compiled against, for the pin assertion in
// build.rs / engine::assert_pinned_version.
-const char * jan_llama_version(void); // e.g. "0.4.1"
-int jan_llama_build_number(void); // e.g. 10964
+const char * jan_llama_version(void); // e.g. "0.5.0"
+int jan_llama_build_number(void); // e.g. 11146
const char * jan_llama_commit(void);
#ifdef __cplusplus
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/commands.rs b/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/commands.rs
index ea2b70192..16285b486 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/commands.rs
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/commands.rs
@@ -529,9 +529,9 @@ pub async fn get_engine_info(
/// therefore no use to a settings screen that wants to name the engine.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EngineVersion {
- /// llama.cpp's own version, e.g. `0.4.1`.
+ /// llama.cpp's own version, e.g. `0.5.0`.
pub version: String,
- /// The upstream build tag the source was taken from, e.g. `b10964`.
+ /// The upstream build tag the source was taken from, e.g. `b11146`.
pub tag: String,
/// The same tag's build number, which is what the shim reports back over
/// the FFI and what a version mismatch is checked against.
diff --git a/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/mod.rs b/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/mod.rs
index 9506313c0..3b218fe40 100644
--- a/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/mod.rs
+++ b/src-tauri/plugins/tauri-plugin-llamacpp/src/engine/mod.rs
@@ -212,9 +212,9 @@ mod tests {
#[test]
fn pin_constants_are_populated_from_build_rs() {
- assert_eq!(PINNED_TAG, "b10964");
- assert_eq!(PINNED_BUILD_NUMBER, "10964");
- assert_eq!(PINNED_VERSION, "0.4.1");
+ assert_eq!(PINNED_TAG, "b11146");
+ assert_eq!(PINNED_BUILD_NUMBER, "11146");
+ assert_eq!(PINNED_VERSION, "0.5.0");
assert_eq!(PINNED_COMMIT.len(), 40, "commit should be a full sha");
}
diff --git a/web-app/src/containers/__tests__/LlamacppEngineInfo.test.tsx b/web-app/src/containers/__tests__/LlamacppEngineInfo.test.tsx
index 947c9c860..8ee410ff4 100644
--- a/web-app/src/containers/__tests__/LlamacppEngineInfo.test.tsx
+++ b/web-app/src/containers/__tests__/LlamacppEngineInfo.test.tsx
@@ -15,10 +15,10 @@ vi.mock('@/hooks/useServiceHub', () => ({
import { LlamacppEngineInfo } from '../LlamacppEngineInfo'
const PIN = {
- version: '0.4.1',
- tag: 'b10964',
- buildNumber: '10964',
- commit: 'b29c606e28a01b1bc8c1351026a0fa6e616bf6c4',
+ version: '0.5.0',
+ tag: 'b11146',
+ buildNumber: '11146',
+ commit: '7fe450e19305b828c199d602c23a8337aaa1f03b',
}
describe('LlamacppEngineInfo', () => {
@@ -31,8 +31,8 @@ describe('LlamacppEngineInfo', () => {
render(<LlamacppEngineInfo />)
expect(await screen.findByText('llama.cpp')).toBeInTheDocument()
- expect(screen.getByText('0.4.1')).toBeInTheDocument()
- expect(screen.getByText('b10964')).toBeInTheDocument()
+ expect(screen.getByText('0.5.0')).toBeInTheDocument()
+ expect(screen.getByText('b11146')).toBeInTheDocument()
})
// A 40-char sha would wrap the row and buys nothing a reader can use; the
@@ -41,13 +41,13 @@ describe('LlamacppEngineInfo', () => {
getEngineVersion.mockResolvedValue(PIN)
render(<LlamacppEngineInfo />)
- expect(await screen.findByText('b29c606e')).toBeInTheDocument()
+ expect(await screen.findByText('7fe450e1')).toBeInTheDocument()
expect(screen.queryByText(PIN.commit)).not.toBeInTheDocument()
expect(
screen.getByRole('link', { name: /engineReleaseNotes/ })
).toHaveAttribute(
'href',
- 'https://github.com/ggml-org/llama.cpp/releases/tag/b10964'
+ 'https://github.com/ggml-org/llama.cpp/releases/tag/b11146'
)
})
diff --git a/web-app/src/services/models/types.ts b/web-app/src/services/models/types.ts
index cb2f46437..6bbb63016 100644
--- a/web-app/src/services/models/types.ts
+++ b/web-app/src/services/models/types.ts
@@ -201,9 +201,9 @@ export interface ModelsService {
* extension, not to the plugin.
*/
export interface EngineVersionInfo {
- /** llama.cpp's own version, e.g. "0.4.1". */
+ /** llama.cpp's own version, e.g. "0.5.0". */
version: string
- /** Upstream build tag, e.g. "b10964". */
+ /** Upstream build tag, e.g. "b11146". */
tag: string
buildNumber: string
/** Full commit sha the build is pinned to. */