File Coverage

blib/lib/AI/Ollama/RequestOptions.pm
Criterion Covered Total %
statement 20 24 83.3
branch n/a
condition n/a
subroutine 7 8 87.5
pod 0 1 0.0
total 27 33 81.8


line stmt bran cond sub pod time code
1             package AI::Ollama::RequestOptions 0.05;
2             # DO NOT EDIT! This is an autogenerated file.
3              
4 1     1   86 use 5.020;
  1         3  
5 1     1   3 use Moo 2;
  1         10  
  1         5  
6 1     1   269 use experimental 'signatures';
  1         2  
  1         5  
7 1     1   106 use stable 'postderef';
  1         2  
  1         4  
8 1     1   64 use Types::Standard qw(Enum Str Bool Num Int HashRef ArrayRef);
  1         2  
  1         5  
9 1     1   1689 use MooX::TypeTiny;
  1         2  
  1         5  
10              
11 1     1   684 use namespace::clean;
  1         2  
  1         6  
12              
13             =encoding utf8
14              
15             =head1 NAME
16              
17             AI::Ollama::RequestOptions -
18              
19             =head1 SYNOPSIS
20              
21             my $obj = AI::Ollama::RequestOptions->new();
22             ...
23              
24             =cut
25              
26 0     0 0   sub as_hash( $self ) {
  0            
  0            
27 0           return { $self->%* }
28             }
29              
30             =head1 PROPERTIES
31              
32             =head2 C<< embedding_only >>
33              
34             Enable embedding only. (Default: false)
35              
36             =cut
37              
38             has 'embedding_only' => (
39             is => 'ro',
40             );
41              
42             =head2 C<< f16_kv >>
43              
44             Enable f16 key/value. (Default: false)
45              
46             =cut
47              
48             has 'f16_kv' => (
49             is => 'ro',
50             );
51              
52             =head2 C<< frequency_penalty >>
53              
54             Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
55              
56             =cut
57              
58             has 'frequency_penalty' => (
59             is => 'ro',
60             isa => Num,
61             );
62              
63             =head2 C<< logits_all >>
64              
65             Enable logits all. (Default: false)
66              
67             =cut
68              
69             has 'logits_all' => (
70             is => 'ro',
71             );
72              
73             =head2 C<< low_vram >>
74              
75             Enable low VRAM mode. (Default: false)
76              
77             =cut
78              
79             has 'low_vram' => (
80             is => 'ro',
81             );
82              
83             =head2 C<< main_gpu >>
84              
85             The GPU to use for the main model. Default is 0.
86              
87             =cut
88              
89             has 'main_gpu' => (
90             is => 'ro',
91             isa => Int,
92             );
93              
94             =head2 C<< mirostat >>
95              
96             Enable Mirostat sampling for controlling perplexity. (default: 0, 0 = disabled, 1 = Mirostat, 2 = Mirostat 2.0)
97              
98             =cut
99              
100             has 'mirostat' => (
101             is => 'ro',
102             isa => Int,
103             );
104              
105             =head2 C<< mirostat_eta >>
106              
107             Influences how quickly the algorithm responds to feedback from the generated text. A lower learning rate will result in slower adjustments, while a higher learning rate will make the algorithm more responsive. (Default: 0.1)
108              
109             =cut
110              
111             has 'mirostat_eta' => (
112             is => 'ro',
113             isa => Num,
114             );
115              
116             =head2 C<< mirostat_tau >>
117              
118             Controls the balance between coherence and diversity of the output. A lower value will result in more focused and coherent text. (Default: 5.0)
119              
120             =cut
121              
122             has 'mirostat_tau' => (
123             is => 'ro',
124             isa => Num,
125             );
126              
127             =head2 C<< num_batch >>
128              
129             Sets the number of batches to use for generation. (Default: 1)
130              
131             =cut
132              
133             has 'num_batch' => (
134             is => 'ro',
135             isa => Int,
136             );
137              
138             =head2 C<< num_ctx >>
139              
140             Sets the size of the context window used to generate the next token.
141              
142             =cut
143              
144             has 'num_ctx' => (
145             is => 'ro',
146             isa => Int,
147             );
148              
149             =head2 C<< num_gpu >>
150              
151             The number of layers to send to the GPU(s). On macOS it defaults to 1 to enable metal support, 0 to disable.
152              
153             =cut
154              
155             has 'num_gpu' => (
156             is => 'ro',
157             isa => Int,
158             );
159              
160             =head2 C<< num_gqa >>
161              
162             The number of GQA groups in the transformer layer. Required for some models, for example it is 8 for `llama2:70b`.
163              
164             =cut
165              
166             has 'num_gqa' => (
167             is => 'ro',
168             isa => Int,
169             );
170              
171             =head2 C<< num_keep >>
172              
173             Number of tokens to keep from the prompt.
174              
175             =cut
176              
177             has 'num_keep' => (
178             is => 'ro',
179             isa => Int,
180             );
181              
182             =head2 C<< num_predict >>
183              
184             Maximum number of tokens to predict when generating text. (Default: 128, -1 = infinite generation, -2 = fill context)
185              
186             =cut
187              
188             has 'num_predict' => (
189             is => 'ro',
190             isa => Int,
191             );
192              
193             =head2 C<< num_thread >>
194              
195             Sets the number of threads to use during computation. By default, Ollama will detect this for optimal performance. It is recommended to set this value to the number of physical CPU cores your system has (as opposed to the logical number of cores).
196              
197             =cut
198              
199             has 'num_thread' => (
200             is => 'ro',
201             isa => Int,
202             );
203              
204             =head2 C<< numa >>
205              
206             Enable NUMA support. (Default: false)
207              
208             =cut
209              
210             has 'numa' => (
211             is => 'ro',
212             );
213              
214             =head2 C<< penalize_newline >>
215              
216             Penalize newlines in the output. (Default: false)
217              
218             =cut
219              
220             has 'penalize_newline' => (
221             is => 'ro',
222             );
223              
224             =head2 C<< presence_penalty >>
225              
226             Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
227              
228             =cut
229              
230             has 'presence_penalty' => (
231             is => 'ro',
232             isa => Num,
233             );
234              
235             =head2 C<< repeat_last_n >>
236              
237             Sets how far back for the model to look back to prevent repetition. (Default: 64, 0 = disabled, -1 = num_ctx)
238              
239             =cut
240              
241             has 'repeat_last_n' => (
242             is => 'ro',
243             isa => Int,
244             );
245              
246             =head2 C<< repeat_penalty >>
247              
248             Sets how strongly to penalize repetitions. A higher value (e.g., 1.5) will penalize repetitions more strongly, while a lower value (e.g., 0.9) will be more lenient. (Default: 1.1)
249              
250             =cut
251              
252             has 'repeat_penalty' => (
253             is => 'ro',
254             isa => Num,
255             );
256              
257             =head2 C<< rope_frequency_base >>
258              
259             The base of the rope frequency scale. (Default: 1.0)
260              
261             =cut
262              
263             has 'rope_frequency_base' => (
264             is => 'ro',
265             isa => Num,
266             );
267              
268             =head2 C<< rope_frequency_scale >>
269              
270             The scale of the rope frequency. (Default: 1.0)
271              
272             =cut
273              
274             has 'rope_frequency_scale' => (
275             is => 'ro',
276             isa => Num,
277             );
278              
279             =head2 C<< seed >>
280              
281             Sets the random number seed to use for generation. Setting this to a specific number will make the model generate the same text for the same prompt. (Default: 0)
282              
283             =cut
284              
285             has 'seed' => (
286             is => 'ro',
287             isa => Int,
288             );
289              
290             =head2 C<< stop >>
291              
292             Sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence.
293              
294             =cut
295              
296             has 'stop' => (
297             is => 'ro',
298             isa => ArrayRef[Str],
299             );
300              
301             =head2 C<< temperature >>
302              
303             The temperature of the model. Increasing the temperature will make the model answer more creatively. (Default: 0.8)
304              
305             =cut
306              
307             has 'temperature' => (
308             is => 'ro',
309             isa => Num,
310             );
311              
312             =head2 C<< tfs_z >>
313              
314             Tail free sampling is used to reduce the impact of less probable tokens from the output. A higher value (e.g., 2.0) will reduce the impact more, while a value of 1.0 disables this setting. (default: 1)
315              
316             =cut
317              
318             has 'tfs_z' => (
319             is => 'ro',
320             isa => Num,
321             );
322              
323             =head2 C<< top_k >>
324              
325             Reduces the probability of generating nonsense. A higher value (e.g. 100) will give more diverse answers, while a lower value (e.g. 10) will be more conservative. (Default: 40)
326              
327             =cut
328              
329             has 'top_k' => (
330             is => 'ro',
331             isa => Int,
332             );
333              
334             =head2 C<< top_p >>
335              
336             Works together with top-k. A higher value (e.g., 0.95) will lead to more diverse text, while a lower value (e.g., 0.5) will generate more focused and conservative text. (Default: 0.9)
337              
338             =cut
339              
340             has 'top_p' => (
341             is => 'ro',
342             isa => Num,
343             );
344              
345             =head2 C<< typical_p >>
346              
347             Typical p is used to reduce the impact of less probable tokens from the output.
348              
349             =cut
350              
351             has 'typical_p' => (
352             is => 'ro',
353             isa => Num,
354             );
355              
356             =head2 C<< use_mlock >>
357              
358             Enable mlock. (Default: false)
359              
360             =cut
361              
362             has 'use_mlock' => (
363             is => 'ro',
364             );
365              
366             =head2 C<< use_mmap >>
367              
368             Enable mmap. (Default: false)
369              
370             =cut
371              
372             has 'use_mmap' => (
373             is => 'ro',
374             );
375              
376             =head2 C<< vocab_only >>
377              
378             Enable vocab only. (Default: false)
379              
380             =cut
381              
382             has 'vocab_only' => (
383             is => 'ro',
384             );
385              
386              
387             1;