MCPcopy Create free account

hub / github.com/abetlen/llama-cpp-python / functions

Functions1,336 in github.com/abetlen/llama-cpp-python

Functionllama_batch_init
Allocates a batch of tokens on the heap that can hold a maximum of n_tokens Each token can be assigned up to n_seq_max sequence ids The batch
llama_cpp/llama_cpp.py:3014
Functionllama_chat_apply_template
Apply chat template. Args: tmpl: Template to use. If None, uses model's default chat: Array of chat messages n_msg: Numbe
llama_cpp/llama_cpp.py:4132
Functionllama_chat_builtin_templates
Get list of built-in chat templates. Args: output: Output buffer to store template names. len: Length of the output buffer.
llama_cpp/llama_cpp.py:4167
Functionllama_context_default_params
Get default parameters for llama_context
llama_cpp/llama_cpp.py:1241
Functionllama_copy_state_data
Copies the state to the specified destination address (DEPRECATED)
llama_cpp/llama_cpp.py:2548
Functionllama_cpp_embedding_model_path
()
tests/test_llama.py:77
Functionllama_cpp_hybrid_model_path
()
tests/test_llama.py:93
Functionllama_cpp_model_path
()
tests/test_llama.py:61
Functionllama_cpp_recurrent_model_path
()
tests/test_llama.py:85
Functionllama_cpp_transformer_model_path
()
tests/test_llama.py:69
Functionllama_decode
Process a batch of tokens. 0 - success 1 - could not find a KV slot for the batch (try reducing the size of the batch or increase the context)
llama_cpp/llama_cpp.py:3071
Functionllama_detokenize
Convert the provided tokens into text (inverse of llama_tokenize()). Args: vocab: The vocabulary to use for tokenization. tokens:
llama_cpp/llama_cpp.py:4075
Functionllama_encode
Process a batch of tokens using the encoder. 0 - success < 0 - error
llama_cpp/llama_cpp.py:3048
Functionllama_flash_attn_type_name
Get the flash attention type name.
llama_cpp/llama_cpp.py:1270
Functionllama_free
Frees all allocated memory
llama_cpp/llama_cpp.py:1543
Functionllama_free_model
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1446
Functionllama_get_ctx_other
Get the context linked through llama_context_params.ctx_other.
llama_cpp/llama_cpp_ext.py:131
Functionllama_get_embeddings
Get the embeddings for the input shape: [n_embd] (1-dimensional)
llama_cpp/llama_cpp.py:3232
Functionllama_get_embeddings_ith
Get the embeddings for the ith sequence llama_get_embeddings(ctx) + i*n_embd
llama_cpp/llama_cpp.py:3249
Functionllama_get_embeddings_nextn
Get the nextn embeddings from the last evaluation.
llama_cpp/llama_cpp_ext.py:94
Functionllama_get_embeddings_nextn_ith
Get the nextn embeddings for the ith output row from the last evaluation.
llama_cpp/llama_cpp_ext.py:112
Functionllama_get_embeddings_seq
Get the embeddings for a sequence id Returns NULL if pooling_type is LLAMA_POOLING_TYPE_NONE shape: [n_embd] (1-dimensional)
llama_cpp/llama_cpp.py:3267
Functionllama_get_logits
Token logits obtained from the last call to llama_decode() The logits for which llama_batch.logits[i] != 0 are stored contiguously in the orde
llama_cpp/llama_cpp.py:3191
Functionllama_get_logits_ith
Logits for the ith token. Equivalent to: llama_get_logits(ctx) + i*n_vocab
llama_cpp/llama_cpp.py:3213
Functionllama_get_memory
Get the memory for the context
llama_cpp/llama_cpp.py:1698
Functionllama_get_model
(ctx: llama_context_p, /)
llama_cpp/llama_cpp.py:1693
Functionllama_get_sampled_candidates_count_ith
Get the backend sampled candidate count for the ith token.
llama_cpp/llama_cpp.py:3363
Functionllama_get_sampled_candidates_ith
Get the backend sampled candidates for the ith token.
llama_cpp/llama_cpp.py:3350
Functionllama_get_sampled_logits_count_ith
Get the backend sampled logit count for the ith token.
llama_cpp/llama_cpp.py:3336
Functionllama_get_sampled_logits_ith
Get the backend sampled logits for the ith token.
llama_cpp/llama_cpp.py:3323
Functionllama_get_sampled_probs_count_ith
Get the backend sampled probability count for the ith token.
llama_cpp/llama_cpp.py:3309
Functionllama_get_sampled_probs_ith
Get the backend sampled probabilities for the ith token.
llama_cpp/llama_cpp.py:3296
Functionllama_get_sampled_token_ith
Get the backend sampled token for the ith token.
llama_cpp/llama_cpp.py:3282
Functionllama_get_state_size
Returns the size in bytes of the state (DEPRECATED)
llama_cpp/llama_cpp.py:2495
Functionllama_init_from_model
( model: llama_model_p, params: llama_context_params, / )
llama_cpp/llama_cpp.py:1504
Functionllama_load_model_from_file
( path_model: bytes, params: llama_model_params, / )
llama_cpp/llama_cpp.py:1350
Functionllama_load_session_file
( ctx: llama_context_p, path_session: bytes, tokens_out: CtypesArray[llama_token], n_token_cap
llama_cpp/llama_cpp.py:2659
Functionllama_log_callback
( level: int, text: bytes, user_data: ctypes.c_void_p, )
llama_cpp/_logger.py:31
Functionllama_log_get
Get the current logging callback and user data.
llama_cpp/llama_cpp.py:4831
Functionllama_log_set
Set callback for all future logging events. If this is not called, or NULL is supplied, everything is output on stderr.
llama_cpp/llama_cpp.py:4846
Functionllama_max_devices
()
llama_cpp/llama_cpp.py:1559
Functionllama_max_parallel_sequences
()
llama_cpp/llama_cpp.py:1564
Functionllama_max_tensor_buft_overrides
Get the maximum number of tensor buffer type overrides.
llama_cpp/llama_cpp.py:1569
Functionllama_memory_can_shift
Check if the memory supports shifting
llama_cpp/llama_cpp.py:2472
Functionllama_memory_clear
Clear the memory contents If data == true, the data buffers will also be cleared together with the metadata
llama_cpp/llama_cpp.py:2278
Functionllama_memory_seq_add
Adds relative position "delta" to all tokens that belong to the specified sequence and have positions in [p0, p1) p0 < 0 : [0, p1] p1 < 0 : [
llama_cpp/llama_cpp.py:2385
Functionllama_memory_seq_cp
Copy all tokens that belong to the specified sequence to another sequence p0 < 0 : [0, p1] p1 < 0 : [p0, inf)
llama_cpp/llama_cpp.py:2341
Functionllama_memory_seq_div
Integer division of the positions by factor of `d > 1` p0 < 0 : [0, p1] p1 < 0 : [p0, inf)
llama_cpp/llama_cpp.py:2419
Functionllama_memory_seq_keep
Removes all tokens that do not belong to the specified sequence
llama_cpp/llama_cpp.py:2360
Functionllama_memory_seq_pos_max
Returns the largest position present in the memory for the specified sequence Return -1 if the sequence is empty
llama_cpp/llama_cpp.py:2461
Functionllama_memory_seq_pos_min
Returns the smallest position present in the memory for the specified sequence This is typically non-zero only for SWA caches Return -1 if the
llama_cpp/llama_cpp.py:2443
Functionllama_memory_seq_rm
Removes all tokens that belong to the specified sequence and have positions in [p0, p1) Returns false if a partial sequence cannot be removed. Re
llama_cpp/llama_cpp.py:2304
Functionllama_model_chat_template
Get the default chat template. Returns None if not available If name is None, returns the default chat template
llama_cpp/llama_cpp.py:1929
Functionllama_model_cls_label
Returns label of classifier output by index. Returns None if no label provided
llama_cpp/llama_cpp.py:1789
Functionllama_model_decoder_start_token
For encoder-decoder models, this function returns id of the token that must be provided to the decoder to start generating output sequence. For ot
llama_cpp/llama_cpp.py:1967
Functionllama_model_default_params
Get default parameters for llama_model
llama_cpp/llama_cpp.py:1230
Functionllama_model_desc
Get a string describing the model type
llama_cpp/llama_cpp.py:1903
Functionllama_model_free
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1463
Functionllama_model_get_vocab
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1710
Functionllama_model_has_decoder
Returns true if the model contains a decoder that requires llama_decode() call
llama_cpp/llama_cpp.py:1956
Functionllama_model_has_encoder
Returns true if the model contains an encoder that requires llama_encode() call
llama_cpp/llama_cpp.py:1948
Functionllama_model_init_from_user
Initialize a model from user-provided metadata and tensor data.
llama_cpp/llama_cpp.py:1485
Functionllama_model_is_diffusion
Returns true if the model is diffusion-based (like LLaDA, Dream, etc.)
llama_cpp/llama_cpp.py:1993
Functionllama_model_is_hybrid
Returns true if the model is hybrid (like Jamba, Granite, etc.)
llama_cpp/llama_cpp.py:1985
Functionllama_model_is_recurrent
Returns true if the model is recurrent (like Mamba, RWKV, etc.)
llama_cpp/llama_cpp.py:1977
Functionllama_model_load_from_file
Load the model from a file If the file is split into multiple parts, the file name must follow this pattern: <name>-%05d-of-%05d.gguf If the
llama_cpp/llama_cpp.py:1379
Functionllama_model_load_from_file_ptr
Load a model from an open FILE pointer.
llama_cpp/llama_cpp.py:1419
Functionllama_model_load_from_splits
Load the model from multiple splits (support custom naming scheme) The paths must be in the correct order
llama_cpp/llama_cpp.py:1401
Functionllama_model_meta_count
Get the number of metadata key/value pairs
llama_cpp/llama_cpp.py:1837
Functionllama_model_meta_key_by_index
Get metadata key name by index
llama_cpp/llama_cpp.py:1862
Functionllama_model_meta_key_str
Get sampling metadata key name. Returns None if the key is invalid.
llama_cpp/llama_cpp.py:1845
Functionllama_model_meta_val_str
Get metadata value as a string by key name
llama_cpp/llama_cpp.py:1823
Functionllama_model_meta_val_str_by_index
Get metadata value as a string by index
llama_cpp/llama_cpp.py:1885
Functionllama_model_n_cls_out
Returns the number of classifier outputs (only valid for classifier models)
llama_cpp/llama_cpp.py:1779
Functionllama_model_n_ctx_train
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1720
Functionllama_model_n_embd
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1725
Functionllama_model_n_embd_inp
Get the model input embedding size.
llama_cpp/llama_cpp.py:1730
Functionllama_model_n_embd_out
Get the model output embedding size.
llama_cpp/llama_cpp.py:1737
Functionllama_model_n_head
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1754
Functionllama_model_n_head_kv
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1759
Functionllama_model_n_layer
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1744
Functionllama_model_n_layer_nextn
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1749
Functionllama_model_n_params
Returns the total number of parameters in the model
llama_cpp/llama_cpp.py:1940
Functionllama_model_n_swa
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1764
Functionllama_model_quantize
Returns 0 on success
llama_cpp/llama_cpp.py:2012
Functionllama_model_quantize_default_params
Get default parameters for llama_model_quantize
llama_cpp/llama_cpp.py:1263
Functionllama_model_rope_freq_scale_train
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1772
Functionllama_model_rope_type
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1715
Functionllama_model_save_to_file
Save the model to a file
llama_cpp/llama_cpp.py:1434
Functionllama_model_size
Returns the total size of all the tensors in the model in bytes
llama_cpp/llama_cpp.py:1916
Functionllama_n_batch
(ctx: llama_context_p, /)
llama_cpp/llama_cpp.py:1608
Functionllama_n_ctx
(ctx: llama_context_p, /)
llama_cpp/llama_cpp.py:1596
Functionllama_n_ctx_seq
Get the context size per sequence.
llama_cpp/llama_cpp.py:1601
Functionllama_n_ctx_train
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1628
Functionllama_n_embd
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1641
Functionllama_n_head
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1667
Functionllama_n_layer
(model: llama_model_p, /)
llama_cpp/llama_cpp.py:1654
Functionllama_n_rs_seq
(ctx: llama_context_p, /)
llama_cpp/llama_cpp.py:1623
Functionllama_n_seq_max
(ctx: llama_context_p, /)
llama_cpp/llama_cpp.py:1618
Functionllama_n_threads
Get the number of threads used for generation of a single token
llama_cpp/llama_cpp.py:3110
← previousnext →901–1,000 of 1,336, ranked by callers