gpt4all 0.1.0

Rust bindings for GPT4All
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
/* automatically generated by rust-bindgen 0.69.4 */

pub const __WORDSIZE: u32 = 64;
pub const __has_safe_buffers: u32 = 1;
pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 1;
pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1;
pub const __DARWIN_ONLY_VERS_1050: u32 = 1;
pub const __DARWIN_UNIX03: u32 = 1;
pub const __DARWIN_64_BIT_INO_T: u32 = 1;
pub const __DARWIN_VERS_1050: u32 = 1;
pub const __DARWIN_NON_CANCELABLE: u32 = 0;
pub const __DARWIN_SUF_EXTSN: &[u8; 14] = b"$DARWIN_EXTSN\0";
pub const __DARWIN_C_ANSI: u32 = 4096;
pub const __DARWIN_C_FULL: u32 = 900000;
pub const __DARWIN_C_LEVEL: u32 = 900000;
pub const __STDC_WANT_LIB_EXT1__: u32 = 1;
pub const __DARWIN_NO_LONG_LONG: u32 = 0;
pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_64_BIT_INODE: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_VERS_1050: u32 = 1;
pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1;
pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3;
pub const __has_ptrcheck: u32 = 0;
pub const __PTHREAD_SIZE__: u32 = 8176;
pub const __PTHREAD_ATTR_SIZE__: u32 = 56;
pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8;
pub const __PTHREAD_MUTEX_SIZE__: u32 = 56;
pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8;
pub const __PTHREAD_COND_SIZE__: u32 = 40;
pub const __PTHREAD_ONCE_SIZE__: u32 = 8;
pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192;
pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const INT64_MAX: u64 = 9223372036854775807;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT64_MIN: i64 = -9223372036854775808;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const UINT64_MAX: i32 = -1;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST64_MIN: i64 = -9223372036854775808;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const INT_LEAST64_MAX: u64 = 9223372036854775807;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const UINT_LEAST64_MAX: i32 = -1;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i32 = -32768;
pub const INT_FAST32_MIN: i32 = -2147483648;
pub const INT_FAST64_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u32 = 32767;
pub const INT_FAST32_MAX: u32 = 2147483647;
pub const INT_FAST64_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: u32 = 65535;
pub const UINT_FAST32_MAX: u32 = 4294967295;
pub const UINT_FAST64_MAX: i32 = -1;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const UINTPTR_MAX: i32 = -1;
pub const SIZE_MAX: i32 = -1;
pub const RSIZE_MAX: i32 = -1;
pub const WINT_MIN: i32 = -2147483648;
pub const WINT_MAX: u32 = 2147483647;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const __bool_true_false_are_defined: u32 = 1;
pub const true_: u32 = 1;
pub const false_: u32 = 0;
pub type int_least8_t = i8;
pub type int_least16_t = i16;
pub type int_least32_t = i32;
pub type int_least64_t = i64;
pub type uint_least8_t = u8;
pub type uint_least16_t = u16;
pub type uint_least32_t = u32;
pub type uint_least64_t = u64;
pub type int_fast8_t = i8;
pub type int_fast16_t = i16;
pub type int_fast32_t = i32;
pub type int_fast64_t = i64;
pub type uint_fast8_t = u8;
pub type uint_fast16_t = u16;
pub type uint_fast32_t = u32;
pub type uint_fast64_t = u64;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_longlong;
pub type __uint64_t = ::std::os::raw::c_ulonglong;
pub type __darwin_intptr_t = ::std::os::raw::c_long;
pub type __darwin_natural_t = ::std::os::raw::c_uint;
pub type __darwin_ct_rune_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Copy, Clone)]
pub union __mbstate_t {
    pub __mbstate8: [::std::os::raw::c_char; 128usize],
    pub _mbstateL: ::std::os::raw::c_longlong,
}
#[test]
fn bindgen_test_layout___mbstate_t() {
    const UNINIT: ::std::mem::MaybeUninit<__mbstate_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<__mbstate_t>(),
        128usize,
        concat!("Size of: ", stringify!(__mbstate_t))
    );
    assert_eq!(
        ::std::mem::align_of::<__mbstate_t>(),
        8usize,
        concat!("Alignment of ", stringify!(__mbstate_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__mbstate8) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(__mbstate_t),
        "::",
        stringify!(__mbstate8)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr)._mbstateL) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(__mbstate_t),
        "::",
        stringify!(_mbstateL)
        )
    );
}
pub type __darwin_mbstate_t = __mbstate_t;
pub type __darwin_ptrdiff_t = ::std::os::raw::c_long;
pub type __darwin_size_t = ::std::os::raw::c_ulong;
pub type __darwin_va_list = __builtin_va_list;
pub type __darwin_wchar_t = ::std::os::raw::c_int;
pub type __darwin_rune_t = __darwin_wchar_t;
pub type __darwin_wint_t = ::std::os::raw::c_int;
pub type __darwin_clock_t = ::std::os::raw::c_ulong;
pub type __darwin_socklen_t = __uint32_t;
pub type __darwin_ssize_t = ::std::os::raw::c_long;
pub type __darwin_time_t = ::std::os::raw::c_long;
pub type __darwin_blkcnt_t = __int64_t;
pub type __darwin_blksize_t = __int32_t;
pub type __darwin_dev_t = __int32_t;
pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint;
pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint;
pub type __darwin_gid_t = __uint32_t;
pub type __darwin_id_t = __uint32_t;
pub type __darwin_ino64_t = __uint64_t;
pub type __darwin_ino_t = __darwin_ino64_t;
pub type __darwin_mach_port_name_t = __darwin_natural_t;
pub type __darwin_mach_port_t = __darwin_mach_port_name_t;
pub type __darwin_mode_t = __uint16_t;
pub type __darwin_off_t = __int64_t;
pub type __darwin_pid_t = __int32_t;
pub type __darwin_sigset_t = __uint32_t;
pub type __darwin_suseconds_t = __int32_t;
pub type __darwin_uid_t = __uint32_t;
pub type __darwin_useconds_t = __uint32_t;
pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize];
pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize];
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct __darwin_pthread_handler_rec {
    pub __routine: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
    pub __arg: *mut ::std::os::raw::c_void,
    pub __next: *mut __darwin_pthread_handler_rec,
}
#[test]
fn bindgen_test_layout___darwin_pthread_handler_rec() {
    const UNINIT: ::std::mem::MaybeUninit<__darwin_pthread_handler_rec> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<__darwin_pthread_handler_rec>(),
        24usize,
        concat!("Size of: ", stringify!(__darwin_pthread_handler_rec))
    );
    assert_eq!(
        ::std::mem::align_of::<__darwin_pthread_handler_rec>(),
        8usize,
        concat!("Alignment of ", stringify!(__darwin_pthread_handler_rec))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__routine) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(__darwin_pthread_handler_rec),
        "::",
        stringify!(__routine)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__arg) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(__darwin_pthread_handler_rec),
        "::",
        stringify!(__arg)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__next) as usize - ptr as usize },
        16usize,
        concat!(
        "Offset of field: ",
        stringify!(__darwin_pthread_handler_rec),
        "::",
        stringify!(__next)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_attr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 56usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_attr_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_attr_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_attr_t>(),
        64usize,
        concat!("Size of: ", stringify!(_opaque_pthread_attr_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_attr_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_attr_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_attr_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_attr_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_cond_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 40usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_cond_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_cond_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_cond_t>(),
        48usize,
        concat!("Size of: ", stringify!(_opaque_pthread_cond_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_cond_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_cond_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_cond_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_cond_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_condattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_condattr_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_condattr_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_condattr_t>(),
        16usize,
        concat!("Size of: ", stringify!(_opaque_pthread_condattr_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_condattr_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_condattr_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_condattr_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_condattr_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_mutex_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 56usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_mutex_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutex_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_mutex_t>(),
        64usize,
        concat!("Size of: ", stringify!(_opaque_pthread_mutex_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_mutex_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_mutex_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_mutex_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_mutex_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_mutexattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_mutexattr_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_mutexattr_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_mutexattr_t>(),
        16usize,
        concat!("Size of: ", stringify!(_opaque_pthread_mutexattr_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_mutexattr_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_mutexattr_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_mutexattr_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_mutexattr_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_once_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 8usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_once_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_once_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_once_t>(),
        16usize,
        concat!("Size of: ", stringify!(_opaque_pthread_once_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_once_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_once_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_once_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_once_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_rwlock_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 192usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_rwlock_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlock_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_rwlock_t>(),
        200usize,
        concat!("Size of: ", stringify!(_opaque_pthread_rwlock_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_rwlock_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_rwlock_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_rwlock_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_rwlock_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_rwlockattr_t {
    pub __sig: ::std::os::raw::c_long,
    pub __opaque: [::std::os::raw::c_char; 16usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_rwlockattr_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_rwlockattr_t> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_rwlockattr_t>(),
        24usize,
        concat!("Size of: ", stringify!(_opaque_pthread_rwlockattr_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_rwlockattr_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_rwlockattr_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_rwlockattr_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_rwlockattr_t),
        "::",
        stringify!(__opaque)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _opaque_pthread_t {
    pub __sig: ::std::os::raw::c_long,
    pub __cleanup_stack: *mut __darwin_pthread_handler_rec,
    pub __opaque: [::std::os::raw::c_char; 8176usize],
}
#[test]
fn bindgen_test_layout__opaque_pthread_t() {
    const UNINIT: ::std::mem::MaybeUninit<_opaque_pthread_t> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<_opaque_pthread_t>(),
        8192usize,
        concat!("Size of: ", stringify!(_opaque_pthread_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_opaque_pthread_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_opaque_pthread_t))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__sig) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_t),
        "::",
        stringify!(__sig)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__cleanup_stack) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_t),
        "::",
        stringify!(__cleanup_stack)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).__opaque) as usize - ptr as usize },
        16usize,
        concat!(
        "Offset of field: ",
        stringify!(_opaque_pthread_t),
        "::",
        stringify!(__opaque)
        )
    );
}
pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t;
pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t;
pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t;
pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong;
pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t;
pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t;
pub type __darwin_pthread_once_t = _opaque_pthread_once_t;
pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t;
pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t;
pub type __darwin_pthread_t = *mut _opaque_pthread_t;
pub type u_int8_t = ::std::os::raw::c_uchar;
pub type u_int16_t = ::std::os::raw::c_ushort;
pub type u_int32_t = ::std::os::raw::c_uint;
pub type u_int64_t = ::std::os::raw::c_ulonglong;
pub type register_t = i64;
pub type user_addr_t = u_int64_t;
pub type user_size_t = u_int64_t;
pub type user_ssize_t = i64;
pub type user_long_t = i64;
pub type user_ulong_t = u_int64_t;
pub type user_time_t = i64;
pub type user_off_t = i64;
pub type syscall_arg_t = u_int64_t;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
pub type rsize_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
pub type max_align_t = f64;
#[doc = " Opaque pointer to the underlying model."]
pub type llmodel_model = *mut ::std::os::raw::c_void;
#[doc = " llmodel_prompt_context structure for holding the prompt context.\n NOTE: The implementation takes care of all the memory handling of the raw logits pointer and the\n raw tokens pointer. Attempting to resize them or modify them in any way can lead to undefined\n behavior."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct llmodel_prompt_context {
    pub logits: *mut f32,
    pub logits_size: usize,
    pub tokens: *mut i32,
    pub tokens_size: usize,
    pub n_past: i32,
    pub n_ctx: i32,
    pub n_predict: i32,
    pub top_k: i32,
    pub top_p: f32,
    pub min_p: f32,
    pub temp: f32,
    pub n_batch: i32,
    pub repeat_penalty: f32,
    pub repeat_last_n: i32,
    pub context_erase: f32,
}
#[test]
fn bindgen_test_layout_llmodel_prompt_context() {
    const UNINIT: ::std::mem::MaybeUninit<llmodel_prompt_context> =
        ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<llmodel_prompt_context>(),
        80usize,
        concat!("Size of: ", stringify!(llmodel_prompt_context))
    );
    assert_eq!(
        ::std::mem::align_of::<llmodel_prompt_context>(),
        8usize,
        concat!("Alignment of ", stringify!(llmodel_prompt_context))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).logits) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(logits)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).logits_size) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(logits_size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tokens) as usize - ptr as usize },
        16usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(tokens)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).tokens_size) as usize - ptr as usize },
        24usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(tokens_size)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).n_past) as usize - ptr as usize },
        32usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(n_past)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).n_ctx) as usize - ptr as usize },
        36usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(n_ctx)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).n_predict) as usize - ptr as usize },
        40usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(n_predict)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).top_k) as usize - ptr as usize },
        44usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(top_k)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).top_p) as usize - ptr as usize },
        48usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(top_p)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).min_p) as usize - ptr as usize },
        52usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(min_p)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).temp) as usize - ptr as usize },
        56usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(temp)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).n_batch) as usize - ptr as usize },
        60usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(n_batch)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).repeat_penalty) as usize - ptr as usize },
        64usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(repeat_penalty)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).repeat_last_n) as usize - ptr as usize },
        68usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(repeat_last_n)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).context_erase) as usize - ptr as usize },
        72usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_prompt_context),
        "::",
        stringify!(context_erase)
        )
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct llmodel_gpu_device {
    pub index: ::std::os::raw::c_int,
    pub type_: ::std::os::raw::c_int,
    pub heapSize: usize,
    pub name: *const ::std::os::raw::c_char,
    pub vendor: *const ::std::os::raw::c_char,
}
#[test]
fn bindgen_test_layout_llmodel_gpu_device() {
    const UNINIT: ::std::mem::MaybeUninit<llmodel_gpu_device> = ::std::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::std::mem::size_of::<llmodel_gpu_device>(),
        32usize,
        concat!("Size of: ", stringify!(llmodel_gpu_device))
    );
    assert_eq!(
        ::std::mem::align_of::<llmodel_gpu_device>(),
        8usize,
        concat!("Alignment of ", stringify!(llmodel_gpu_device))
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize },
        0usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_gpu_device),
        "::",
        stringify!(index)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize },
        4usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_gpu_device),
        "::",
        stringify!(type_)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).heapSize) as usize - ptr as usize },
        8usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_gpu_device),
        "::",
        stringify!(heapSize)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).name) as usize - ptr as usize },
        16usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_gpu_device),
        "::",
        stringify!(name)
        )
    );
    assert_eq!(
        unsafe { ::std::ptr::addr_of!((*ptr).vendor) as usize - ptr as usize },
        24usize,
        concat!(
        "Offset of field: ",
        stringify!(llmodel_gpu_device),
        "::",
        stringify!(vendor)
        )
    );
}
#[doc = " Callback type for prompt processing.\n @param token_id The token id of the prompt.\n @return a bool indicating whether the model should keep processing."]
pub type llmodel_prompt_callback =
::std::option::Option<unsafe extern "C" fn(token_id: i32) -> bool>;
#[doc = " Callback type for response.\n @param token_id The token id of the response.\n @param response The response string. NOTE: a token_id of -1 indicates the string is an error string.\n @return a bool indicating whether the model should keep generating."]
pub type llmodel_response_callback = ::std::option::Option<
    unsafe extern "C" fn(token_id: i32, response: *const ::std::os::raw::c_char) -> bool,
>;
#[doc = " Callback type for recalculation of context.\n @param whether the model is recalculating the context.\n @return a bool indicating whether the model should keep generating."]
pub type llmodel_recalculate_callback =
::std::option::Option<unsafe extern "C" fn(is_recalculating: bool) -> bool>;
#[doc = " Embedding cancellation callback for use with llmodel_embed.\n @param batch_sizes The number of tokens in each batch that will be embedded.\n @param n_batch The number of batches that will be embedded.\n @param backend The backend that will be used for embedding. One of \"cpu\", \"kompute\", or \"metal\".\n @return True to cancel llmodel_embed, false to continue."]
pub type llmodel_emb_cancel_callback = ::std::option::Option<
    unsafe extern "C" fn(
        batch_sizes: *mut ::std::os::raw::c_uint,
        n_batch: ::std::os::raw::c_uint,
        backend: *const ::std::os::raw::c_char,
    ) -> bool,
>;
extern "C" {
    #[doc = " Create a llmodel instance.\n Recognises correct model type from file at model_path\n @param model_path A string representing the path to the model file.\n @return A pointer to the llmodel_model instance; NULL on error."]
    pub fn llmodel_model_create(model_path: *const ::std::os::raw::c_char) -> llmodel_model;
}
extern "C" {
    #[doc = " Create a llmodel instance.\n Recognises correct model type from file at model_path\n @param model_path A string representing the path to the model file; will only be used to detect model type.\n @param build_variant A string representing the implementation to use (auto, default, avxonly, ...),\n @param error A pointer to a string; will only be set on error.\n @return A pointer to the llmodel_model instance; NULL on error."]
    pub fn llmodel_model_create2(
        model_path: *const ::std::os::raw::c_char,
        build_variant: *const ::std::os::raw::c_char,
        error: *mut *const ::std::os::raw::c_char,
    ) -> llmodel_model;
}
extern "C" {
    #[doc = " Destroy a llmodel instance.\n Recognises correct model type using type info\n @param model a pointer to a llmodel_model instance."]
    pub fn llmodel_model_destroy(model: llmodel_model);
}
extern "C" {
    #[doc = " Estimate RAM requirement for a model file\n @param model A pointer to the llmodel_model instance.\n @param model_path A string representing the path to the model file.\n @param n_ctx Maximum size of context window\n @param ngl Number of GPU layers to use (Vulkan)\n @return size greater than 0 if the model was parsed successfully, 0 if file could not be parsed."]
    pub fn llmodel_required_mem(
        model: llmodel_model,
        model_path: *const ::std::os::raw::c_char,
        n_ctx: ::std::os::raw::c_int,
        ngl: ::std::os::raw::c_int,
    ) -> usize;
}
extern "C" {
    #[doc = " Load a model from a file.\n @param model A pointer to the llmodel_model instance.\n @param model_path A string representing the path to the model file.\n @param n_ctx Maximum size of context window\n @param ngl Number of GPU layers to use (Vulkan)\n @return true if the model was loaded successfully, false otherwise."]
    pub fn llmodel_loadModel(
        model: llmodel_model,
        model_path: *const ::std::os::raw::c_char,
        n_ctx: ::std::os::raw::c_int,
        ngl: ::std::os::raw::c_int,
    ) -> bool;
}
extern "C" {
    #[doc = " Check if a model is loaded.\n @param model A pointer to the llmodel_model instance.\n @return true if the model is loaded, false otherwise."]
    pub fn llmodel_isModelLoaded(model: llmodel_model) -> bool;
}
extern "C" {
    #[doc = " Get the size of the internal state of the model.\n NOTE: This state data is specific to the type of model you have created.\n @param model A pointer to the llmodel_model instance.\n @return the size in bytes of the internal state of the model"]
    pub fn llmodel_get_state_size(model: llmodel_model) -> u64;
}
extern "C" {
    #[doc = " Saves the internal state of the model to the specified destination address.\n NOTE: This state data is specific to the type of model you have created.\n @param model A pointer to the llmodel_model instance.\n @param dest A pointer to the destination.\n @return the number of bytes copied"]
    pub fn llmodel_save_state_data(model: llmodel_model, dest: *mut u8) -> u64;
}
extern "C" {
    #[doc = " Restores the internal state of the model using data from the specified address.\n NOTE: This state data is specific to the type of model you have created.\n @param model A pointer to the llmodel_model instance.\n @param src A pointer to the src.\n @return the number of bytes read"]
    pub fn llmodel_restore_state_data(model: llmodel_model, src: *const u8) -> u64;
}
extern "C" {
    #[doc = " Generate a response using the model.\n @param model A pointer to the llmodel_model instance.\n @param prompt A string representing the input prompt.\n @param prompt_template A string representing the input prompt template.\n @param prompt_callback A callback function for handling the processing of prompt.\n @param response_callback A callback function for handling the generated response.\n @param recalculate_callback A callback function for handling recalculation requests.\n @param special True if special tokens in the prompt should be processed, false otherwise.\n @param fake_reply A string to insert into context as the model's reply, or NULL to generate one.\n @param ctx A pointer to the llmodel_prompt_context structure."]
    pub fn llmodel_prompt(
        model: llmodel_model,
        prompt: *const ::std::os::raw::c_char,
        prompt_template: *const ::std::os::raw::c_char,
        prompt_callback: llmodel_prompt_callback,
        response_callback: llmodel_response_callback,
        recalculate_callback: llmodel_recalculate_callback,
        ctx: *mut llmodel_prompt_context,
        special: bool,
        fake_reply: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    #[doc = " Generate an embedding using the model.\n NOTE: If given NULL pointers for the model or text, or an empty text, a NULL pointer will be\n returned. Bindings should signal an error when NULL is the return value.\n @param model A pointer to the llmodel_model instance.\n @param texts A pointer to a NULL-terminated array of strings representing the texts to generate an\n embedding for.\n @param embedding_size A pointer to a size_t type that will be set by the call indicating the length\n of the returned floating point array.\n @param prefix The model-specific prefix representing the embedding task, without the trailing colon. NULL for no\n prefix.\n @param dimensionality The embedding dimension, for use with Matryoshka-capable models. Set to -1 to for full-size.\n @param token_count Return location for the number of prompt tokens processed, or NULL.\n @param do_mean True to average multiple embeddings if the text is longer than the model can accept, False to\n truncate.\n @param atlas Try to be fully compatible with the Atlas API. Currently, this means texts longer than 8192 tokens with\n long_text_mode=\"mean\" will raise an error. Disabled by default.\n @param cancel_cb Cancellation callback, or NULL. See the documentation of llmodel_emb_cancel_callback.\n @param error Return location for a malloc()ed string that will be set on error, or NULL.\n @return A pointer to an array of floating point values passed to the calling method which then will\n be responsible for lifetime of this memory. NULL if an error occurred."]
    pub fn llmodel_embed(
        model: llmodel_model,
        texts: *mut *const ::std::os::raw::c_char,
        embedding_size: *mut usize,
        prefix: *const ::std::os::raw::c_char,
        dimensionality: ::std::os::raw::c_int,
        token_count: *mut usize,
        do_mean: bool,
        atlas: bool,
        cancel_cb: llmodel_emb_cancel_callback,
        error: *mut *const ::std::os::raw::c_char,
    ) -> *mut f32;
}
extern "C" {
    #[doc = " Frees the memory allocated by the llmodel_embedding function.\n @param ptr A pointer to the embedding as returned from llmodel_embedding."]
    pub fn llmodel_free_embedding(ptr: *mut f32);
}
extern "C" {
    #[doc = " Set the number of threads to be used by the model.\n @param model A pointer to the llmodel_model instance.\n @param n_threads The number of threads to be used."]
    pub fn llmodel_setThreadCount(model: llmodel_model, n_threads: i32);
}
extern "C" {
    #[doc = " Get the number of threads currently being used by the model.\n @param model A pointer to the llmodel_model instance.\n @return The number of threads currently being used."]
    pub fn llmodel_threadCount(model: llmodel_model) -> i32;
}
extern "C" {
    #[doc = " Set llmodel implementation search path.\n Default is \".\"\n @param path The path to the llmodel implementation shared objects. This can be a single path or\n a list of paths separated by ';' delimiter."]
    pub fn llmodel_set_implementation_search_path(path: *const ::std::os::raw::c_char);
}
extern "C" {
    #[doc = " Get llmodel implementation search path.\n @return The current search path; lifetime ends on next set llmodel_set_implementation_search_path() call."]
    pub fn llmodel_get_implementation_search_path() -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " Get a list of available GPU devices given the memory required.\n @param memoryRequired The minimum amount of VRAM, in bytes\n @return A pointer to an array of llmodel_gpu_device's whose number is given by num_devices."]
    pub fn llmodel_available_gpu_devices(
        memoryRequired: usize,
        num_devices: *mut ::std::os::raw::c_int,
    ) -> *mut llmodel_gpu_device;
}
extern "C" {
    #[doc = " Initializes a GPU device based on a specified string criterion.\n\n This function initializes a GPU device based on a string identifier provided. The function\n allows initialization based on general device type (\"gpu\"), vendor name (\"amd\", \"nvidia\", \"intel\"),\n or any specific device name.\n\n @param memoryRequired The amount of memory (in bytes) required by the application or task\n                       that will utilize the GPU device.\n @param device A string specifying the desired criterion for GPU device selection. It can be:\n               - \"gpu\": To initialize the best available GPU.\n               - \"amd\", \"nvidia\", or \"intel\": To initialize the best available GPU from that vendor.\n               - A specific GPU device name: To initialize a GPU with that exact name.\n\n @return True if the GPU device is successfully initialized based on the provided string\n         criterion. Returns false if the desired GPU device could not be initialized."]
    pub fn llmodel_gpu_init_gpu_device_by_string(
        model: llmodel_model,
        memoryRequired: usize,
        device: *const ::std::os::raw::c_char,
    ) -> bool;
}
extern "C" {
    #[doc = " Initializes a GPU device by specifying a valid gpu device pointer.\n @param device A gpu device pointer.\n @return True if the GPU device is successfully initialized, false otherwise."]
    pub fn llmodel_gpu_init_gpu_device_by_struct(
        model: llmodel_model,
        device: *const llmodel_gpu_device,
    ) -> bool;
}
extern "C" {
    #[doc = " Initializes a GPU device by its index.\n @param device An integer representing the index of the GPU device to be initialized.\n @return True if the GPU device is successfully initialized, false otherwise."]
    pub fn llmodel_gpu_init_gpu_device_by_int(
        model: llmodel_model,
        device: ::std::os::raw::c_int,
    ) -> bool;
}
extern "C" {
    #[doc = " @return True if a GPU device is successfully initialized, false otherwise."]
    pub fn llmodel_has_gpu_device(model: llmodel_model) -> bool;
}
extern "C" {
    #[doc = " @return The name of the llama.cpp backend currently in use. One of \"cpu\", \"kompute\", or \"metal\"."]
    pub fn llmodel_model_backend_name(model: llmodel_model) -> *const ::std::os::raw::c_char;
}
extern "C" {
    #[doc = " @return The name of the GPU device currently in use, or NULL for backends other than Kompute."]
    pub fn llmodel_model_gpu_device_name(model: llmodel_model) -> *const ::std::os::raw::c_char;
}
pub type __builtin_va_list = *mut ::std::os::raw::c_char;