llama_cpp_dart_ffi library
Low-level ffigen API to llama.cpp's C API, wrapping libllama.so.
You will need 'dart:ffi' and 'package:ffi/ffi.dart' to use this effectively.
Classes
- ggml_backend
- ggml_backend_buffer
- ggml_backend_buffer_type
- ggml_backend_dev_caps
- ggml_backend_dev_props
- ggml_backend_device
- ggml_backend_event
- ggml_backend_graph_copy
- ggml_backend_reg
- ggml_backend_sched
- ggml_bf16_t
- ggml_cgraph
- ggml_context
- ggml_cplan
- ggml_gallocr
- ggml_init_params
- ggml_object
- ggml_tallocr
- ggml_tensor
- ggml_threadpool
- ggml_threadpool_params
- ggml_type_traits
- ggml_type_traits_cpu
- gguf_context
- gguf_init_params
- llama_batch
- llama_chat_message
- llama_context
- llama_context_params
- llama_cpp
- llama.cpp binding
- llama_kv_cache_view
- llama_kv_cache_view_cell
- llama_logit_bias
- llama_lora_adapter
- llama_model
- llama_model_kv_override
- llama_model_params
- llama_model_quantize_params
- llama_perf_context_data
- llama_perf_sampler_data
- llama_sampler
- llama_sampler_chain_params
- llama_sampler_i
- llama_token_data
- llama_token_data_array
- UnnamedUnion1
Enums
- ggml_backend_buffer_usage
- ggml_backend_dev_type
- ggml_backend_type
- ggml_ftype
- ggml_log_level
- ggml_numa_strategy
- ggml_object_type
- ggml_op
- ggml_op_pool
- ggml_prec
- ggml_sched_priority
- ggml_sort_order
- ggml_status
- ggml_tensor_flag
- ggml_type
- ggml_unary_op
- gguf_type
- llama_attention_type
- llama_ftype
- llama_model_kv_override_type
- llama_pooling_type
- llama_rope_scaling_type
- llama_rope_type
- llama_split_mode
- llama_token_attr
- llama_token_type
- llama_vocab_pre_type
- llama_vocab_type
Constants
- BUFSIZ → const int
- EOF → const int
- false1 → const int
- FILENAME_MAX → const int
- FOPEN_MAX → const int
- GGML_DEFAULT_GRAPH_SIZE → const int
- GGML_DEFAULT_N_THREADS → const int
- GGML_EXIT_ABORTED → const int
- GGML_EXIT_SUCCESS → const int
- GGML_FILE_MAGIC → const int
- GGML_FILE_VERSION → const int
- GGML_KQ_MASK_PAD → const int
- GGML_MAX_DIMS → const int
- GGML_MAX_N_THREADS → const int
- GGML_MAX_NAME → const int
- GGML_MAX_OP_PARAMS → const int
- GGML_MAX_PARAMS → const int
- GGML_MAX_SRC → const int
- GGML_MEM_ALIGN → const int
- GGML_N_TASKS_MAX → const int
- GGML_QNT_VERSION → const int
- GGML_QNT_VERSION_FACTOR → const int
- GGML_ROPE_TYPE_NEOX → const int
- GGUF_DEFAULT_ALIGNMENT → const int
- GGUF_MAGIC → const String
- GGUF_VERSION → const int
- INT16_MAX → const int
- INT16_MIN → const int
- INT32_MAX → const int
- INT32_MIN → const int
- INT64_MAX → const int
- INT64_MIN → const int
- INT8_MAX → const int
- INT8_MIN → const int
- INT_FAST16_MAX → const int
- INT_FAST16_MIN → const int
- INT_FAST32_MAX → const int
- INT_FAST32_MIN → const int
- INT_FAST64_MAX → const int
- INT_FAST64_MIN → const int
- INT_FAST8_MAX → const int
- INT_FAST8_MIN → const int
- INT_LEAST16_MAX → const int
- INT_LEAST16_MIN → const int
- INT_LEAST32_MAX → const int
- INT_LEAST32_MIN → const int
- INT_LEAST64_MAX → const int
- INT_LEAST64_MIN → const int
- INT_LEAST8_MAX → const int
- INT_LEAST8_MIN → const int
- INTMAX_MAX → const int
- INTMAX_MIN → const int
- INTPTR_MAX → const int
- INTPTR_MIN → const int
- L_ctermid → const int
- L_tmpnam → const int
- LLAMA_DEFAULT_SEED → const int
- LLAMA_FILE_MAGIC_GGLA → const int
- LLAMA_FILE_MAGIC_GGSN → const int
- LLAMA_FILE_MAGIC_GGSQ → const int
- LLAMA_SESSION_MAGIC → const int
- LLAMA_SESSION_VERSION → const int
- LLAMA_STATE_SEQ_MAGIC → const int
- LLAMA_STATE_SEQ_VERSION → const int
- LLAMA_TOKEN_NULL → const int
- MAC_OS_VERSION_11_0 → const int
- MAC_OS_VERSION_11_1 → const int
- MAC_OS_VERSION_11_3 → const int
- MAC_OS_VERSION_11_4 → const int
- MAC_OS_VERSION_11_5 → const int
- MAC_OS_VERSION_11_6 → const int
- MAC_OS_VERSION_12_0 → const int
- MAC_OS_VERSION_12_1 → const int
- MAC_OS_VERSION_12_2 → const int
- MAC_OS_VERSION_12_3 → const int
- MAC_OS_VERSION_12_4 → const int
- MAC_OS_VERSION_12_5 → const int
- MAC_OS_VERSION_12_6 → const int
- MAC_OS_VERSION_12_7 → const int
- MAC_OS_VERSION_13_0 → const int
- MAC_OS_VERSION_13_1 → const int
- MAC_OS_VERSION_13_2 → const int
- MAC_OS_VERSION_13_3 → const int
- MAC_OS_VERSION_13_4 → const int
- MAC_OS_VERSION_13_5 → const int
- MAC_OS_VERSION_13_6 → const int
- MAC_OS_VERSION_14_0 → const int
- MAC_OS_VERSION_14_1 → const int
- MAC_OS_VERSION_14_2 → const int
- MAC_OS_VERSION_14_3 → const int
- MAC_OS_VERSION_14_4 → const int
- MAC_OS_VERSION_14_5 → const int
- MAC_OS_VERSION_15_0 → const int
- MAC_OS_VERSION_15_1 → const int
- MAC_OS_X_VERSION_10_0 → const int
- MAC_OS_X_VERSION_10_1 → const int
- MAC_OS_X_VERSION_10_10 → const int
- MAC_OS_X_VERSION_10_10_2 → const int
- MAC_OS_X_VERSION_10_10_3 → const int
- MAC_OS_X_VERSION_10_11 → const int
- MAC_OS_X_VERSION_10_11_2 → const int
- MAC_OS_X_VERSION_10_11_3 → const int
- MAC_OS_X_VERSION_10_11_4 → const int
- MAC_OS_X_VERSION_10_12 → const int
- MAC_OS_X_VERSION_10_12_1 → const int
- MAC_OS_X_VERSION_10_12_2 → const int
- MAC_OS_X_VERSION_10_12_4 → const int
- MAC_OS_X_VERSION_10_13 → const int
- MAC_OS_X_VERSION_10_13_1 → const int
- MAC_OS_X_VERSION_10_13_2 → const int
- MAC_OS_X_VERSION_10_13_4 → const int
- MAC_OS_X_VERSION_10_14 → const int
- MAC_OS_X_VERSION_10_14_1 → const int
- MAC_OS_X_VERSION_10_14_4 → const int
- MAC_OS_X_VERSION_10_14_5 → const int
- MAC_OS_X_VERSION_10_14_6 → const int
- MAC_OS_X_VERSION_10_15 → const int
- MAC_OS_X_VERSION_10_15_1 → const int
- MAC_OS_X_VERSION_10_15_4 → const int
- MAC_OS_X_VERSION_10_16 → const int
- MAC_OS_X_VERSION_10_2 → const int
- MAC_OS_X_VERSION_10_3 → const int
- MAC_OS_X_VERSION_10_4 → const int
- MAC_OS_X_VERSION_10_5 → const int
- MAC_OS_X_VERSION_10_6 → const int
- MAC_OS_X_VERSION_10_7 → const int
- MAC_OS_X_VERSION_10_8 → const int
- MAC_OS_X_VERSION_10_9 → const int
- NULL → const int
- P_tmpdir → const String
- PTRDIFF_MAX → const int
- PTRDIFF_MIN → const int
- RENAME_EXCL → const int
- RENAME_NOFOLLOW_ANY → const int
- RENAME_RESERVED1 → const int
- RENAME_SECLUDE → const int
- RENAME_SWAP → const int
- RSIZE_MAX → const int
- SEEK_CUR → const int
- SEEK_DATA → const int
- SEEK_END → const int
- SEEK_HOLE → const int
- SEEK_SET → const int
- SIG_ATOMIC_MAX → const int
- SIG_ATOMIC_MIN → const int
- SIZE_MAX → const int
- TMP_MAX → const int
- true1 → const int
- UINT16_MAX → const int
- UINT32_MAX → const int
- UINT64_MAX → const int
- UINT8_MAX → const int
- UINT_FAST16_MAX → const int
- UINT_FAST32_MAX → const int
- UINT_FAST64_MAX → const int
- UINT_FAST8_MAX → const int
- UINT_LEAST16_MAX → const int
- UINT_LEAST32_MAX → const int
- UINT_LEAST64_MAX → const int
- UINT_LEAST8_MAX → const int
- UINTMAX_MAX → const int
- UINTPTR_MAX → const int
- USER_ADDR_NULL → const int
- WCHAR_MAX → const int
- WCHAR_MIN → const int
- WINT_MAX → const int
- WINT_MIN → const int
Typedefs
- Dart__darwin_clock_t = int
- Dart__darwin_ct_rune_t = int
- Dart__darwin_fsblkcnt_t = int
- Dart__darwin_fsfilcnt_t = int
- Dart__darwin_intptr_t = int
- Dart__darwin_natural_t = int
- Dart__darwin_nl_item = int
- Dart__darwin_pthread_key_t = int
- Dart__darwin_ptrdiff_t = int
- Dart__darwin_size_t = int
- Dart__darwin_ssize_t = int
- Dart__darwin_time_t = int
- Dart__darwin_wchar_t = int
- Dart__darwin_wctrans_t = int
- Dart__darwin_wint_t = int
- Dart__int16_t = int
- Dart__int32_t = int
- Dart__int64_t = int
- Dart__int8_t = int
- Dart__uint16_t = int
- Dart__uint32_t = int
- Dart__uint64_t = int
- Dart__uint8_t = int
-
Dartggml_abort_callbackFunction
= bool Function(Pointer<
Void> data) -
Dartggml_backend_eval_callbackFunction
= bool Function(int node_index, Pointer<
ggml_tensor> t1, Pointer<ggml_tensor> t2, Pointer<Void> user_data) -
Dartggml_backend_sched_eval_callbackFunction
= bool Function(Pointer<
ggml_tensor> t, bool ask, Pointer<Void> user_data) - Dartggml_backend_set_n_threads_tFunction = void Function(ggml_backend_t backend, int n_threads)
-
Dartggml_backend_split_buffer_type_tFunction
= ggml_backend_buffer_type_t Function(int main_device, Pointer<
Float> tensor_split) -
Dartggml_binary_op_f32_tFunction
= void Function(int, Pointer<
Float> , Pointer<Float> , Pointer<Float> ) -
Dartggml_custom1_op_f32_tFunction
= void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> ) -
Dartggml_custom1_op_tFunction
= void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, int ith, int nth, Pointer<Void> userdata) -
Dartggml_custom2_op_f32_tFunction
= void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> ) -
Dartggml_custom2_op_tFunction
= void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, Pointer<ggml_tensor> b, int ith, int nth, Pointer<Void> userdata) -
Dartggml_custom3_op_f32_tFunction
= void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> ) -
Dartggml_custom3_op_tFunction
= void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, Pointer<ggml_tensor> b, Pointer<ggml_tensor> c, int ith, int nth, Pointer<Void> userdata) - Dartggml_fp16_t = int
-
Dartggml_from_float_tFunction
= void Function(Pointer<
Float> x, Pointer<Void> y, int k) -
Dartggml_from_float_to_mat_tFunction
= void Function(Pointer<
Float> x, Pointer<Void> y, int nr, int k, int bs) -
Dartggml_gemm_tFunction
= void Function(int n, Pointer<
Float> s, int bs, Pointer<Void> x, Pointer<Void> y, int nr, int nc) -
Dartggml_gemv_tFunction
= void Function(int n, Pointer<
Float> s, int bs, Pointer<Void> x, Pointer<Void> y, int nr, int nc) -
Dartggml_log_callbackFunction
= void Function(ggml_log_level level, Pointer<
Char> text, Pointer<Void> user_data) -
Dartggml_to_float_tFunction
= void Function(Pointer<
Void> x, Pointer<Float> y, int k) -
Dartggml_unary_op_f32_tFunction
= void Function(int, Pointer<
Float> , Pointer<Float> ) -
Dartggml_vec_dot_tFunction
= void Function(int n, Pointer<
Float> s, int bs, Pointer<Void> x, int bx, Pointer<Void> y, int by, int nrc) - Dartint_fast16_t = int
- Dartint_fast32_t = int
- Dartint_fast64_t = int
- Dartint_fast8_t = int
- Dartint_least16_t = int
- Dartint_least32_t = int
- Dartint_least64_t = int
- Dartint_least8_t = int
- Dartintmax_t = int
- Dartllama_pos = int
-
Dartllama_progress_callbackFunction
= bool Function(double progress, Pointer<
Void> user_data) - Dartllama_seq_id = int
- Dartllama_token = int
- Dartregister_t = int
- Dartu_int16_t = int
- Dartu_int32_t = int
- Dartu_int64_t = int
- Dartu_int8_t = int
- Dartuint_fast16_t = int
- Dartuint_fast32_t = int
- Dartuint_fast64_t = int
- Dartuint_fast8_t = int
- Dartuint_least16_t = int
- Dartuint_least32_t = int
- Dartuint_least64_t = int
- Dartuint_least8_t = int
- Dartuintmax_t = int
- Dartuser_long_t = int
- Dartuser_off_t = int
- Dartuser_ssize_t = int
- Dartuser_time_t = int
- FILE = __sFILE
- fpos_t = __darwin_off_t
-
ggml_abort_callback
= Pointer<
NativeFunction< ggml_abort_callbackFunction> > -
ggml_abort_callbackFunction
= Bool Function(Pointer<
Void> data) -
ggml_backend_buffer_t
= Pointer<
ggml_backend_buffer> -
ggml_backend_buffer_type_t
= Pointer<
ggml_backend_buffer_type> -
ggml_backend_dev_get_extra_bufts_t
= Pointer<
NativeFunction< ggml_backend_dev_get_extra_bufts_tFunction> > -
ggml_backend_dev_get_extra_bufts_tFunction
= Pointer<
ggml_backend_buffer_type_t> Function(ggml_backend_dev_t device) -
ggml_backend_dev_t
= Pointer<
ggml_backend_device> -
ggml_backend_eval_callback
= Pointer<
NativeFunction< ggml_backend_eval_callbackFunction> > -
ggml_backend_eval_callbackFunction
= Bool Function(Int node_index, Pointer<
ggml_tensor> t1, Pointer<ggml_tensor> t2, Pointer<Void> user_data) -
ggml_backend_event_t
= Pointer<
ggml_backend_event> -
ggml_backend_graph_plan_t
= Pointer<
Void> -
ggml_backend_reg_t
= Pointer<
ggml_backend_reg> -
ggml_backend_sched_eval_callback
= Pointer<
NativeFunction< ggml_backend_sched_eval_callbackFunction> > -
ggml_backend_sched_eval_callbackFunction
= Bool Function(Pointer<
ggml_tensor> t, Bool ask, Pointer<Void> user_data) -
ggml_backend_sched_t
= Pointer<
ggml_backend_sched> -
ggml_backend_set_n_threads_t
= Pointer<
NativeFunction< ggml_backend_set_n_threads_tFunction> > - ggml_backend_set_n_threads_tFunction = Void Function(ggml_backend_t backend, Int n_threads)
-
ggml_backend_split_buffer_type_t
= Pointer<
NativeFunction< ggml_backend_split_buffer_type_tFunction> > -
ggml_backend_split_buffer_type_tFunction
= ggml_backend_buffer_type_t Function(Int main_device, Pointer<
Float> tensor_split) -
ggml_backend_t
= Pointer<
ggml_backend> -
ggml_binary_op_f32_t
= Pointer<
NativeFunction< ggml_binary_op_f32_tFunction> > -
ggml_binary_op_f32_tFunction
= Void Function(Int, Pointer<
Float> , Pointer<Float> , Pointer<Float> ) -
ggml_custom1_op_f32_t
= Pointer<
NativeFunction< ggml_custom1_op_f32_tFunction> > -
ggml_custom1_op_f32_tFunction
= Void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> ) -
ggml_custom1_op_t
= Pointer<
NativeFunction< ggml_custom1_op_tFunction> > -
ggml_custom1_op_tFunction
= Void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, Int ith, Int nth, Pointer<Void> userdata) -
ggml_custom2_op_f32_t
= Pointer<
NativeFunction< ggml_custom2_op_f32_tFunction> > -
ggml_custom2_op_f32_tFunction
= Void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> ) -
ggml_custom2_op_t
= Pointer<
NativeFunction< ggml_custom2_op_tFunction> > -
ggml_custom2_op_tFunction
= Void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, Pointer<ggml_tensor> b, Int ith, Int nth, Pointer<Void> userdata) -
ggml_custom3_op_f32_t
= Pointer<
NativeFunction< ggml_custom3_op_f32_tFunction> > -
ggml_custom3_op_f32_tFunction
= Void Function(Pointer<
ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> , Pointer<ggml_tensor> ) -
ggml_custom3_op_t
= Pointer<
NativeFunction< ggml_custom3_op_tFunction> > -
ggml_custom3_op_tFunction
= Void Function(Pointer<
ggml_tensor> dst, Pointer<ggml_tensor> a, Pointer<ggml_tensor> b, Pointer<ggml_tensor> c, Int ith, Int nth, Pointer<Void> userdata) - ggml_fp16_t = Uint16
-
ggml_from_float_t
= Pointer<
NativeFunction< ggml_from_float_tFunction> > -
ggml_from_float_tFunction
= Void Function(Pointer<
Float> x, Pointer<Void> y, Int64 k) -
ggml_from_float_to_mat_t
= Pointer<
NativeFunction< ggml_from_float_to_mat_tFunction> > -
ggml_from_float_to_mat_tFunction
= Void Function(Pointer<
Float> x, Pointer<Void> y, Int64 nr, Int64 k, Int64 bs) -
ggml_gallocr_t
= Pointer<
ggml_gallocr> -
ggml_gemm_t
= Pointer<
NativeFunction< ggml_gemm_tFunction> > -
ggml_gemm_tFunction
= Void Function(Int n, Pointer<
Float> s, Size bs, Pointer<Void> x, Pointer<Void> y, Int nr, Int nc) -
ggml_gemv_t
= Pointer<
NativeFunction< ggml_gemv_tFunction> > -
ggml_gemv_tFunction
= Void Function(Int n, Pointer<
Float> s, Size bs, Pointer<Void> x, Pointer<Void> y, Int nr, Int nc) -
ggml_guid_t
= Pointer<
Pointer< Uint8> > -
ggml_log_callback
= Pointer<
NativeFunction< ggml_log_callbackFunction> > -
ggml_log_callbackFunction
= Void Function(UnsignedInt level, Pointer<
Char> text, Pointer<Void> user_data) -
ggml_threadpool_t
= Pointer<
ggml_threadpool> -
ggml_to_float_t
= Pointer<
NativeFunction< ggml_to_float_tFunction> > -
ggml_to_float_tFunction
= Void Function(Pointer<
Void> x, Pointer<Float> y, Int64 k) -
ggml_unary_op_f32_t
= Pointer<
NativeFunction< ggml_unary_op_f32_tFunction> > -
ggml_unary_op_f32_tFunction
= Void Function(Int, Pointer<
Float> , Pointer<Float> ) -
ggml_vec_dot_t
= Pointer<
NativeFunction< ggml_vec_dot_tFunction> > -
ggml_vec_dot_tFunction
= Void Function(Int n, Pointer<
Float> s, Size bs, Pointer<Void> x, Size bx, Pointer<Void> y, Size by, Int nrc) - int_fast16_t = Int16
- int_fast32_t = Int32
- int_fast64_t = Int64
- int_fast8_t = Int8
- int_least16_t = Int16
- int_least32_t = Int32
- int_least64_t = Int64
- int_least8_t = Int8
- intmax_t = Long
- llama_pos = Int32
-
llama_progress_callback
= Pointer<
NativeFunction< llama_progress_callbackFunction> > -
llama_progress_callbackFunction
= Bool Function(Float progress, Pointer<
Void> user_data) -
llama_sampler_context_t
= Pointer<
Void> - llama_seq_id = Int32
- llama_token = Int32
- off_t = __darwin_off_t
- ptrdiff_t = __darwin_ptrdiff_t
- register_t = Int64
- rsize_t = __darwin_size_t
- ssize_t = __darwin_ssize_t
- syscall_arg_t = u_int64_t
- u_int16_t = UnsignedShort
- u_int32_t = UnsignedInt
- u_int64_t = UnsignedLongLong
- u_int8_t = UnsignedChar
- uint_fast16_t = Uint16
- uint_fast32_t = Uint32
- uint_fast64_t = Uint64
- uint_fast8_t = Uint8
- uint_least16_t = Uint16
- uint_least32_t = Uint32
- uint_least64_t = Uint64
- uint_least8_t = Uint8
- uintmax_t = UnsignedLong
- user_addr_t = u_int64_t
- user_long_t = Int64
- user_off_t = Int64
- user_size_t = u_int64_t
- user_ssize_t = Int64
- user_time_t = Int64
- user_ulong_t = u_int64_t
- va_list = __darwin_va_list
- wint_t = __darwin_wint_t