llama_cpp 0.24.2 → 0.24.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/ext/llama_cpp/llama_cpp.c +139 -4
- data/lib/llama_cpp/version.rb +2 -2
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4ec06dde3c07e65bccca17e900a37042082fc706c8cddd34e447affe1198ba5
|
|
4
|
+
data.tar.gz: a4ed3057e3da8fc8be59ab578faf7fdd89773c17a6ee99d03cb25bb5a9af282d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 71803b7ed68c4c9911bf1a91a63e5a5e8d588e297f8ba8d9a28665e06cc367c2eecf6b644033b57ab50358aacc4cb3c6c69f44c54a121dc521fd843e2d4ac727
|
|
7
|
+
data.tar.gz: f35964446f5d954531da4f62862007b97123e158211b01817ffba01409569a8f949b30cf2dc8b8915eebffcf90793978fa5d9d25abf3fbacee991ccfbef48ea8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [[0.24.2](https://github.com/yoshoku/llama_cpp.rb/compare/v0.24.2...v0.24.3)] - 2026-04-06
|
|
2
|
+
|
|
3
|
+
- Change supported llama.cpp version to b8640.
|
|
4
|
+
- Add `LlamaModelImatrixData` class to `LlamaCpp`.
|
|
5
|
+
- Add `LlamaModelTensorOverride` class to `LlamaCpp`.
|
|
6
|
+
|
|
1
7
|
## [[0.24.2](https://github.com/yoshoku/llama_cpp.rb/compare/v0.24.1...v0.24.2)] - 2026-03-15
|
|
2
8
|
|
|
3
9
|
- Change supported llama.cpp version to b8340.
|
data/ext/llama_cpp/llama_cpp.c
CHANGED
|
@@ -7,6 +7,8 @@ VALUE rb_cLlamaContext;
|
|
|
7
7
|
VALUE rb_cLlamaModelTensorBuftOverride;
|
|
8
8
|
VALUE rb_cLlamaModelParams;
|
|
9
9
|
VALUE rb_cLlamaContextParams;
|
|
10
|
+
VALUE rb_cLlamaModelTensorOverride;
|
|
11
|
+
VALUE rb_cLlamaModelImatrixData;
|
|
10
12
|
VALUE rb_cLlamaModelQuantizeParams;
|
|
11
13
|
VALUE rb_cLlamaLogitBias;
|
|
12
14
|
VALUE rb_cLlamaAdapterLora;
|
|
@@ -892,6 +894,100 @@ static VALUE llama_context_params_set_kv_unified(VALUE self, VALUE kv_unified) {
|
|
|
892
894
|
return kv_unified;
|
|
893
895
|
}
|
|
894
896
|
|
|
897
|
+
/* struct llama_model_tensor_override */
|
|
898
|
+
static void llama_model_tensor_override_free(void *ptr) {
|
|
899
|
+
if (ptr) {
|
|
900
|
+
ruby_xfree(ptr);
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
static size_t llama_model_tensor_override_size(const void *ptr) {
|
|
905
|
+
return sizeof(*((struct llama_model_tensor_override*)ptr));
|
|
906
|
+
}
|
|
907
|
+
|
|
908
|
+
static rb_data_type_t llama_model_tensor_override_type = {
|
|
909
|
+
"LlamaModelTensorOverride",
|
|
910
|
+
{ NULL,
|
|
911
|
+
llama_model_tensor_override_free,
|
|
912
|
+
llama_model_tensor_override_size },
|
|
913
|
+
NULL,
|
|
914
|
+
NULL,
|
|
915
|
+
RUBY_TYPED_FREE_IMMEDIATELY
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
static VALUE llama_model_tensor_override_alloc(VALUE self) {
|
|
919
|
+
struct llama_model_tensor_override* data = (struct llama_model_tensor_override*)ruby_xmalloc(sizeof(struct llama_model_tensor_override));
|
|
920
|
+
return TypedData_Wrap_Struct(self, &llama_model_tensor_override_type, data);
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
static struct llama_model_tensor_override* get_llama_model_tensor_override(VALUE self) {
|
|
924
|
+
struct llama_model_tensor_override* data = NULL;
|
|
925
|
+
TypedData_Get_Struct(self, struct llama_model_tensor_override, &llama_model_tensor_override_type, data);
|
|
926
|
+
return data;
|
|
927
|
+
}
|
|
928
|
+
|
|
929
|
+
static VALUE llama_model_tensor_override_get_pattern(VALUE self) {
|
|
930
|
+
struct llama_model_tensor_override* data = get_llama_model_tensor_override(self);
|
|
931
|
+
const char* pattern = data->pattern;
|
|
932
|
+
return rb_utf8_str_new_cstr(pattern);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
static VALUE llama_model_tensor_override_get_type(VALUE self) {
|
|
936
|
+
struct llama_model_tensor_override* data = get_llama_model_tensor_override(self);
|
|
937
|
+
return INT2NUM(data->type);
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
/* struct llama_model_imatrix_data */
|
|
941
|
+
static void llama_model_imatrix_data_free(void *ptr) {
|
|
942
|
+
if (ptr) {
|
|
943
|
+
ruby_xfree(ptr);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
static size_t llama_model_imatrix_data_size(const void *ptr) {
|
|
948
|
+
return sizeof(*((struct llama_model_imatrix_data*)ptr));
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
static rb_data_type_t llama_model_imatrix_data_type = {
|
|
952
|
+
"LlamaModelImatrixData",
|
|
953
|
+
{ NULL,
|
|
954
|
+
llama_model_imatrix_data_free,
|
|
955
|
+
llama_model_imatrix_data_size },
|
|
956
|
+
NULL,
|
|
957
|
+
NULL,
|
|
958
|
+
RUBY_TYPED_FREE_IMMEDIATELY
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
static VALUE llama_model_imatrix_data_alloc(VALUE self) {
|
|
962
|
+
struct llama_model_imatrix_data* data = (struct llama_model_imatrix_data*)ruby_xmalloc(sizeof(struct llama_model_imatrix_data));
|
|
963
|
+
return TypedData_Wrap_Struct(self, &llama_model_imatrix_data_type, data);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
static struct llama_model_imatrix_data* get_llama_model_imatrix_data(VALUE self) {
|
|
967
|
+
struct llama_model_imatrix_data* data = NULL;
|
|
968
|
+
TypedData_Get_Struct(self, struct llama_model_imatrix_data, &llama_model_imatrix_data_type, data);
|
|
969
|
+
return data;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
static VALUE llama_model_imatrix_data_get_name(VALUE self) {
|
|
973
|
+
struct llama_model_imatrix_data* data = get_llama_model_imatrix_data(self);
|
|
974
|
+
return rb_utf8_str_new_cstr(data->name);
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
static VALUE llama_model_imatrix_data_get_size(VALUE self) {
|
|
978
|
+
struct llama_model_imatrix_data* data = get_llama_model_imatrix_data(self);
|
|
979
|
+
return SIZET2NUM(data->size);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
static VALUE llama_model_imatrix_data_get_data(VALUE self) {
|
|
983
|
+
struct llama_model_imatrix_data* data = get_llama_model_imatrix_data(self);
|
|
984
|
+
VALUE ary = rb_ary_new2(data->size);
|
|
985
|
+
for (size_t i = 0; i < data->size; i++) {
|
|
986
|
+
rb_ary_store(ary, i, DBL2NUM(data->data[i]));
|
|
987
|
+
}
|
|
988
|
+
return ary;
|
|
989
|
+
}
|
|
990
|
+
|
|
895
991
|
/* llama_model_quantize_params */
|
|
896
992
|
static void llama_model_quantize_params_free(void *ptr) {
|
|
897
993
|
if (ptr) {
|
|
@@ -4811,6 +4907,45 @@ void Init_llama_cpp(void) {
|
|
|
4811
4907
|
/* TODO: ggml_abort_callback abort_callback */
|
|
4812
4908
|
/* TODO: void* abort_callback_data */
|
|
4813
4909
|
|
|
4910
|
+
/**
|
|
4911
|
+
* Document-class: LlamaCpp::LlamaModelTensorOverride
|
|
4912
|
+
* "struct llama_model_tensor_override" wrapper class
|
|
4913
|
+
*/
|
|
4914
|
+
rb_cLlamaModelTensorOverride = rb_define_class_under(rb_mLlamaCpp, "LlamaModelTensorOverride", rb_cObject);
|
|
4915
|
+
rb_define_alloc_func(rb_cLlamaModelTensorOverride, llama_model_tensor_override_alloc);
|
|
4916
|
+
/**
|
|
4917
|
+
* Document-method: pattern
|
|
4918
|
+
* @return [String]
|
|
4919
|
+
*/
|
|
4920
|
+
rb_define_method(rb_cLlamaModelTensorOverride, "pattern", RUBY_METHOD_FUNC(llama_model_tensor_override_get_pattern), 0);
|
|
4921
|
+
/**
|
|
4922
|
+
* Document-method: type
|
|
4923
|
+
* @return [Integer]
|
|
4924
|
+
*/
|
|
4925
|
+
rb_define_method(rb_cLlamaModelTensorOverride, "type", RUBY_METHOD_FUNC(llama_model_tensor_override_get_type), 0);
|
|
4926
|
+
|
|
4927
|
+
/**
|
|
4928
|
+
* Document-class: LlamaCpp::LlamaModelImatrixData
|
|
4929
|
+
* "struct llama_model_i_matrix_data" wrapper class
|
|
4930
|
+
*/
|
|
4931
|
+
rb_cLlamaModelImatrixData = rb_define_class_under(rb_mLlamaCpp, "LlamaModelImatrixData", rb_cObject);
|
|
4932
|
+
rb_define_alloc_func(rb_cLlamaModelImatrixData, llama_model_imatrix_data_alloc);
|
|
4933
|
+
/**
|
|
4934
|
+
* Document-method: name
|
|
4935
|
+
* @return [String]
|
|
4936
|
+
*/
|
|
4937
|
+
rb_define_method(rb_cLlamaModelImatrixData, "name", RUBY_METHOD_FUNC(llama_model_imatrix_data_get_name), 0);
|
|
4938
|
+
/**
|
|
4939
|
+
* Document-method: size
|
|
4940
|
+
* @return [Integer]
|
|
4941
|
+
*/
|
|
4942
|
+
rb_define_method(rb_cLlamaModelImatrixData, "size", RUBY_METHOD_FUNC(llama_model_imatrix_data_get_size), 0);
|
|
4943
|
+
/**
|
|
4944
|
+
* Document-method: data
|
|
4945
|
+
* @return [Array<Float>]
|
|
4946
|
+
*/
|
|
4947
|
+
rb_define_method(rb_cLlamaModelImatrixData, "data", RUBY_METHOD_FUNC(llama_model_imatrix_data_get_data), 0);
|
|
4948
|
+
|
|
4814
4949
|
/**
|
|
4815
4950
|
* Document-class: LlamaCpp::LlamaModelQuantizeParams
|
|
4816
4951
|
* "struct llama_model_quantize_params" wrapper class
|
|
@@ -4927,10 +5062,10 @@ void Init_llama_cpp(void) {
|
|
|
4927
5062
|
* @return [Boolean]
|
|
4928
5063
|
*/
|
|
4929
5064
|
rb_define_method(rb_cLlamaModelQuantizeParams, "dry_run=", RUBY_METHOD_FUNC(llama_model_quantize_params_set_dry_run), 1);
|
|
4930
|
-
/* TODO:
|
|
4931
|
-
/* TODO:
|
|
4932
|
-
/* TODO:
|
|
4933
|
-
/* TODO:
|
|
5065
|
+
/* TODO: const struct llama_model_imatrix_data* imatrix */
|
|
5066
|
+
/* TODO: const struct llama_model_kv_override* kv_overrides */
|
|
5067
|
+
/* TODO: const struct llama_model_tensor_override* tt_overrides */
|
|
5068
|
+
/* TODO: const int32_t* prune_layers */
|
|
4934
5069
|
|
|
4935
5070
|
/**
|
|
4936
5071
|
* Document-class: LlamaCpp::LlamaLogitBias
|
data/lib/llama_cpp/version.rb
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
# llama_cpp.rb provides Ruby bindings for the llama.cpp.
|
|
4
4
|
module LlamaCpp
|
|
5
5
|
# The version of llama_cpp.rb you install.
|
|
6
|
-
VERSION = '0.24.
|
|
6
|
+
VERSION = '0.24.3'
|
|
7
7
|
|
|
8
8
|
# The supported version of llama.cpp.
|
|
9
|
-
LLAMA_CPP_VERSION = '
|
|
9
|
+
LLAMA_CPP_VERSION = 'b8640'
|
|
10
10
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: llama_cpp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.24.
|
|
4
|
+
version: 0.24.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yoshoku
|
|
@@ -33,7 +33,7 @@ metadata:
|
|
|
33
33
|
homepage_uri: https://github.com/yoshoku/llama_cpp.rb
|
|
34
34
|
source_code_uri: https://github.com/yoshoku/llama_cpp.rb
|
|
35
35
|
changelog_uri: https://github.com/yoshoku/llama_cpp.rb/blob/main/CHANGELOG.md
|
|
36
|
-
documentation_uri: https://gemdocs.org/gems/llama_cpp/0.24.
|
|
36
|
+
documentation_uri: https://gemdocs.org/gems/llama_cpp/0.24.3/
|
|
37
37
|
rubygems_mfa_required: 'true'
|
|
38
38
|
rdoc_options: []
|
|
39
39
|
require_paths:
|
|
@@ -49,7 +49,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
49
49
|
- !ruby/object:Gem::Version
|
|
50
50
|
version: '0'
|
|
51
51
|
requirements: []
|
|
52
|
-
rubygems_version: 4.0.
|
|
52
|
+
rubygems_version: 4.0.6
|
|
53
53
|
specification_version: 4
|
|
54
54
|
summary: Ruby bindings for the llama.cpp.
|
|
55
55
|
test_files: []
|