llama_cpp 0.17.9 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8e90419e0ffcd183523d6aa45f2ef54d4a5697d80e0862e6c358e27ba4a6a1e
4
- data.tar.gz: 85128e367d0523e99a5302b9c765c20d6d55b3ed357f1785921f31a5fc2a0cea
3
+ metadata.gz: 0a9263eee75a3d91907c711565799fd25820d8d2b0f0ae9818a24a0798b49bf4
4
+ data.tar.gz: 9f05051e8972baea44c4bd33f63190d5da8a62156c419fc02ec6b96ea3545c31
5
5
  SHA512:
6
- metadata.gz: 76218e8970d649e01ebfee4c90727d1d563bf1f456727910a0755e52642e50ddf65160ee4c8613632eab419747f933aaced032f331293bed6e59810539b1fa05
7
- data.tar.gz: b3aa1b46bb1262fd681c677fbcf10bcc43eb507b3fd3db9c1c243b5c61c87ab290b1a38e3eb265109d2a4e5bbcc61bc9aa0a2d84aaf004822af2f529afb436bd
6
+ metadata.gz: 2543f1022462d32694649f2226d097537672bd6921af4fe6948687e00ef007b2e0425110abc7a3240d5dceb25131a3641bc9614f0e1117f3a7a40dcc55b23190
7
+ data.tar.gz: 0c54ea7e7617e99f52b0f005e8f871d5f69423e92d350bc93562ba56b48ff85a88ee6c3f01e1e6a71a0782a1bcf212f4900c7b88229a63935349cbdabee95cfc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## [[0.18.0](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.10...v0.18.0)] - 2025-02-02
2
+
3
+ **Breaking Changes**
4
+ All the native extensions code was rewritten in C. The high-level API has been removed and replaced with a simple bindings library.
5
+ The fast update speed of llama.cpp makes it difficult to keep up with the creation of this binding library.
6
+ [As previously noted](https://github.com/yoshoku/llama_cpp.rb/blob/main/CHANGELOG.md#060---2023-09-30),
7
+ the author has given up on continuing to develop this binding library. Thank you for your understanding.
8
+
9
+ ## [[0.17.10](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.9...v0.17.10)] - 2024-09-07
10
+
11
+ - Change supported llama.cpp version to b3676.
12
+ - Add `LLAMA_VOCAB_TYPE_RWKV` constant.
13
+ - Add `LLAMA_FTYPE_MOSTLY_TQ1_0` and `LLAMA_FTYPE_MOSTLY_TQ2_0` constants.
14
+ - Change type of n_threads and n_threads_batch from uint32_t to int32 in native extension codes.
15
+
16
+ Implementation bindings for llama_attach_threadpool and llama_detach_threadpool have been skipped.
17
+
1
18
  ## [[0.17.9](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.8...v0.17.9)] - 2024-08-31
2
19
 
3
20
  - Change supported llama.cpp version to b3639.
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2023-2024 Atsushi Tatsuma
3
+ Copyright (c) 2023-2025 Atsushi Tatsuma
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -57,41 +57,20 @@ An example of Ruby code that generates sentences with the quantization model is
57
57
  ```ruby
58
58
  require 'llama_cpp'
59
59
 
60
- model_params = LLaMACpp::ModelParams.new
61
- model = LLaMACpp::Model.new(model_path: '/home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin', params: model_params)
60
+ LlamaCpp.ggml_backend_load_all
62
61
 
63
- context_params = LLaMACpp::ContextParams.new
64
- context_params.seed = 42
65
- context = LLaMACpp::Context.new(model: model, params: context_params)
62
+ model_params = LlamaCpp::LlamaModelParams.new
63
+ model = LlamaCpp::llama_model_load_from_file('/home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin', model_params)
66
64
 
67
- puts LLaMACpp.generate(context, 'Hello, World.')
68
- ```
69
-
70
- ## Examples
71
- There is a sample program in the [examples](https://github.com/yoshoku/llama_cpp.rb/tree/main/examples) directory that allow interactvie communication like ChatGPT.
72
-
73
- ```sh
74
- $ git clone https://github.com/yoshoku/llama_cpp.rb.git
75
- $ cd examples
76
- $ bundle install
77
- $ ruby chat.rb --model /home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin --seed 2023
78
- ...
79
- User: Who is the originator of the Ruby programming language?
80
- Bob: The originator of the Ruby programming language is Mr. Yukihiro Matsumoto.
81
- User:
82
- ```
83
-
84
- ![llama_cpp_chat_example](https://github.com/yoshoku/llama_cpp.rb/assets/5562409/374ae3d8-63a6-498f-ae6e-5552b464bdda)
65
+ context_params = LlamaCpp::LlamaContextParams.new
66
+ context = LlamaCpp.llama_init_from_model(model, context_params)
85
67
 
86
- Japanse chat is also possible using the [Vicuna model on Hugging Face](https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized).
68
+ puts LLaMACpp.generate(context, 'Hello, World.')
87
69
 
88
- ```sh
89
- $ wget https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized/resolve/main/ggml-vicuna-7b-1.1-q4_0.bin
90
- $ ruby chat.rb --model ggml-vicuna-7b-1.1-q4_0.bin --file prompt_jp.txt
70
+ LlamaCpp.llama_free(context)
71
+ LlamaCpp.llama_model_free(model)
91
72
  ```
92
73
 
93
- ![llama_cpp rb-jpchat](https://github.com/yoshoku/llama_cpp.rb/assets/5562409/526ff18c-2bb2-4b06-8933-f72960024033)
94
-
95
74
  ## Contributing
96
75
 
97
76
  Bug reports and pull requests are welcome on GitHub at https://github.com/yoshoku/llama_cpp.rb.
@@ -2,10 +2,7 @@
2
2
 
3
3
  require 'mkmf'
4
4
 
5
- abort('libstdc++ is not found.') unless have_library('stdc++')
6
5
  abort('libllama is not found.') unless have_library('llama')
7
6
  abort('llama.h is not found.') unless have_header('llama.h')
8
7
 
9
- $CXXFLAGS << ' -std=c++11'
10
-
11
8
  create_makefile('llama_cpp/llama_cpp')