llama_cpp 0.17.10 → 0.18.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec7b41006345cfe57e355d207718ae460a5a2c519d67027daddb7d40ab346754
4
- data.tar.gz: efcfa7eef5374790cef788f719bede1ab3cd30e5dec79be0ba9844bfbcd433c2
3
+ metadata.gz: 66599243db8e088ab250be615f142cc0c3d63ee0f7661e8300dbd569fd100ac5
4
+ data.tar.gz: 2bfdbc95133df7939276547dbae237c5ccd2175a1a8cee2e81cc3579bf3fa00a
5
5
  SHA512:
6
- metadata.gz: c39150e77652060fcfee2c73b1334ff53ed40caf58679efa727a0d0d54bffe036b8795be9751cef8517b5d4b2300fb77fa5753a9c94b803988ec429b999591c2
7
- data.tar.gz: 6054dee2f39ac2690de2836405ac793bf987538ef0780cffab2700544bc60ceaca8a4b109407c66dcf2dd9f38ffe6b98659d7ca4ddb5c9e93fa85d9884cea26e
6
+ metadata.gz: 365cad9872ed2601700de4a4a4fc7ef5a13c307e4b8ba199f0b3b2c567dd252e402661fd9161f663c3b5dd2fff70f2c935e333b904a0923de0e8aa9955319b63
7
+ data.tar.gz: 4b5275081819595983bb9681951b7c25e1764e7039951368624fc8dc5bdbee9848136f0f98624f1cc07575a76d09e63bf3b2f88effd1ea1c0edd098dd0bb050f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+
2
+ ## [[0.18.1](https://github.com/yoshoku/llama_cpp.rb/compare/v0.18.0...v0.18.1)] - 2025-02-15
3
+
4
+ - Change supported llama.cpp version to b4713
5
+ - Add `llama_sampler_init_top_n_sigma` module function.
6
+ - Remove old type declaration file.
7
+
8
+ ## [[0.18.0](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.10...v0.18.0)] - 2025-02-02
9
+
10
+ **Breaking Changes**
11
+
12
+ All the native extensions code was rewritten in C. The high-level API has been removed and replaced with a simple bindings library.
13
+ The fast update speed of llama.cpp makes it difficult to keep up with the creation of this binding library.
14
+ [As previously noted](https://github.com/yoshoku/llama_cpp.rb/blob/main/CHANGELOG.md#060---2023-09-30),
15
+ the author has given up on continuing to develop this binding library. Thank you for your understanding.
16
+
1
17
  ## [[0.17.10](https://github.com/yoshoku/llama_cpp.rb/compare/v0.17.9...v0.17.10)] - 2024-09-07
2
18
 
3
19
  - Change supported llama.cpp version to b3676.
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
@@ -6,8 +6,6 @@
6
6
 
7
7
  llama_cpp.rb provides Ruby bindings for the [llama.cpp](https://github.com/ggerganov/llama.cpp).
8
8
 
9
- This gem is still under development and may undergo many changes in the future.
10
-
11
9
  ## Installation
12
10
 
13
11
  Install the llama.cpp. If you use homebrew, install it by executing:
@@ -57,41 +55,20 @@ An example of Ruby code that generates sentences with the quantization model is
57
55
  ```ruby
58
56
  require 'llama_cpp'
59
57
 
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)
62
-
63
- context_params = LLaMACpp::ContextParams.new
64
- context_params.seed = 42
65
- context = LLaMACpp::Context.new(model: model, params: context_params)
58
+ LlamaCpp.ggml_backend_load_all
66
59
 
67
- puts LLaMACpp.generate(context, 'Hello, World.')
68
- ```
60
+ model_params = LlamaCpp::LlamaModelParams.new
61
+ model = LlamaCpp::llama_model_load_from_file('/home/user/llama.cpp/models/open_llama_7b/ggml-model-q4_0.bin', model_params)
69
62
 
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.
63
+ context_params = LlamaCpp::LlamaContextParams.new
64
+ context = LlamaCpp.llama_init_from_model(model, context_params)
72
65
 
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)
85
-
86
- Japanse chat is also possible using the [Vicuna model on Hugging Face](https://huggingface.co/CRD716/ggml-vicuna-1.1-quantized).
66
+ puts LLaMACpp.generate(context, 'Hello, World.')
87
67
 
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
68
+ LlamaCpp.llama_free(context)
69
+ LlamaCpp.llama_model_free(model)
91
70
  ```
92
71
 
93
- ![llama_cpp rb-jpchat](https://github.com/yoshoku/llama_cpp.rb/assets/5562409/526ff18c-2bb2-4b06-8933-f72960024033)
94
-
95
72
  ## Contributing
96
73
 
97
74
  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')