Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/abetlen/llama-cpp-python
/ functions
Functions
1,336 in github.com/abetlen/llama-cpp-python
⨍
Functions
1,336
◇
Types & classes
256
↳
Endpoints
95
Function
decorator
(f)
llama_cpp/llama_cpp_ext.py:26
Function
decorator
(f: LlamaChatCompletionHandler)
llama_cpp/llama_chat_format.py:157
Method
default_params
Get the default llama_model_params.
llama_cpp/_internals.py:242
Method
default_params
Get the default llama_context_params.
llama_cpp/_internals.py:462
Method
desc
(self)
llama_cpp/_internals.py:106
Function
detokenize
( body: DetokenizeInputRequest, llama_proxy: LlamaProxy = Depends(get_llama_proxy), )
llama_cpp/server/app.py:591
Method
detokenize
Detokenize the tokens into text. Args: tokens: The list of tokens to detokenize. prev_tokens: The list of previous to
llama_cpp/llama_tokenizer.py:29
Method
detokenize
( self, tokens: List[int], prev_tokens: Optional[List[int]] = None, special: b
llama_cpp/llama_tokenizer.py:88
Method
draft
( self, input_ids: np.ndarray, /, *, seq_id: int, max_tokens:
examples/server/server.py:1213
Method
draft_many
( self, requests: Sequence[Tuple[np.ndarray, int, Optional[int]]], /, )
examples/server/server.py:1818
Method
end_pos
(self)
examples/server/server.py:3867
Method
eval_logits
(self)
llama_cpp/llama.py:589
Method
eval_token_count
(self)
examples/server/server.py:3955
Method
eval_tokens
(self)
llama_cpp/llama.py:585
Method
exact_checkpoints_only
(self)
examples/server/server.py:11752
Method
extend
( self, sequence_id: int, tokens: Sequence[int], position_increments: Optional
examples/server/server.py:1045
Method
find_first
(s: str, substrs: List[str])
llama_cpp/llama_chat_format.py:3162
Method
fingerprint_file
(path: str)
examples/server/server.py:10433
Function
format_alpaca
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1084
Function
format_autotokenizer
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:770
Function
format_baichuan
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1163
Function
format_baichuan2
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1147
Function
format_chatglm3
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1381
Function
format_chatml
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1343
Function
format_gemma
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1440
Function
format_intel
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1253
Function
format_llama2
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1050
Function
format_llama3
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1067
Function
format_mistral_instruct
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1360
Function
format_mistrallite
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1294
Function
format_oasst_llama
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1131
Function
format_open_orca
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1267
Function
format_openbuddy
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1179
Function
format_openchat
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1398
Function
format_phind
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1239
Function
format_pygmalion
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1327
Function
format_qwen
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1098
Function
format_redpajama_incite
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1201
Function
format_saiga
( messages: list[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1418
Function
format_snoozy
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1217
Function
format_tokenizer_config
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:817
Function
format_zephyr
( messages: List[llama_types.ChatCompletionRequestMessage], **kwargs: Any, )
llama_cpp/llama_chat_format.py:1310
Method
free
(self)
llama_cpp/server/model.py:68
Method
free_batch
()
llama_cpp/_internals.py:485
Method
free_ctx
()
llama_cpp/_internals.py:272
Method
free_lora_adapter
()
llama_cpp/llama.py:439
Method
free_model
()
llama_cpp/_internals.py:72
Method
free_sampler
()
llama_cpp/_internals.py:682
Method
free_wrapper
(sampler: llama_cpp.llama_sampler_p)
llama_cpp/_internals.py:654
Method
from_file
(cls, file: Union[str, Path], verbose: bool = True)
llama_cpp/llama_grammar.py:29
Method
from_ggml_file
(cls, path: str)
llama_cpp/llama_tokenizer.py:73
Method
from_pretrained
(cls, pretrained_model_name_or_path: str)
llama_cpp/llama_tokenizer.py:109
Method
from_pretrained
( cls, repo_id: str, filename: Optional[str], local_dir: Optional[Union[str, o
llama_cpp/llama_chat_format.py:3185
Function
functionary_chat_handler
( llama: llama.Llama, messages: List[llama_types.ChatCompletionRequestMessage], functions: Optiona
llama_cpp/llama_chat_format.py:1461
Function
functionary_v1_v2_chat_handler
( llama: llama.Llama, messages: List[llama_types.ChatCompletionRequestMessage], functions: Optiona
llama_cpp/llama_chat_format.py:1824
Function
get_chat_completion_handler
(name: str)
llama_cpp/llama_chat_format.py:150
Method
get_dot
()
llama_cpp/llama_grammar.py:541
Method
get_dot
()
examples/server/server.py:382
Method
get_embeddings
(self)
llama_cpp/_internals.py:351
Method
get_embeddings_ith
(self, i: int)
llama_cpp/_internals.py:354
Method
get_embeddings_seq
(self, seq_id: int)
llama_cpp/_internals.py:357
Function
get_event_publisher
( request: Request, inner_send_chan: MemoryObjectSendStream[typing.Any], body: CreateCompletionReq
llama_cpp/server/app.py:191
Function
get_llama_proxy
()
llama_cpp/server/app.py:73
Method
get_logits_ith
(self, i: int)
llama_cpp/_internals.py:348
Function
get_models
( llama_proxy: LlamaProxy = Depends(get_llama_proxy), )
llama_cpp/server/app.py:535
Method
get_recursive_refs
(ks, first_is_optional)
llama_cpp/llama_grammar.py:906
Method
get_recursive_refs
(keys: List[str], first_is_optional: bool)
examples/server/server.py:733
Method
get_route_handler
Defines custom route handler that catches exceptions and formats in OpenAI style error response
llama_cpp/server/errors.py:162
Method
get_seed
(self)
llama_cpp/_internals.py:854
Method
get_state_size
(self)
llama_cpp/_internals.py:315
Method
grammar_accept_token
(self, grammar: LlamaGrammar, token: int)
llama_cpp/_internals.py:449
Function
guess_chat_format_from_gguf_metadata
(metadata: Dict[str, str])
llama_cpp/llama_chat_format.py:853
Method
has_attention_budget
(self)
examples/server/server.py:11756
Function
healthz
()
examples/server/server.py:16332
Function
hf_autotokenizer_to_chat_completion_handler
( pretrained_model_name_or_path: Union[str, os.PathLike[str]], )
llama_cpp/llama_chat_format.py:787
Function
hf_tokenizer_config_to_chat_completion_handler
( tokenizer_config: Dict[str, Any], add_generation_prompt: bool = True, )
llama_cpp/llama_chat_format.py:843
Method
join_seq
()
llama_cpp/llama_grammar.py:549
Method
join_sequence
()
examples/server/server.py:386
Method
kv_cache_seq_cp
(self, seq_id_src: int, seq_id_dst: int, p0: int, p1: int)
llama_cpp/_internals.py:303
Method
kv_cache_seq_keep
(self, seq_id: int)
llama_cpp/_internals.py:307
Method
kv_cache_seq_shift
(self, seq_id: int, p0: int, p1: int, shift: int)
llama_cpp/_internals.py:311
Method
last
(self)
llama_cpp/_internals.py:620
Method
length
(self)
examples/server/server.py:3951
Method
length
(self)
examples/server/server.py:4140
Function
list_models
()
examples/server/server.py:16316
Function
llama_adapter_get_alora_invocation_tokens
Get the invocation tokens if the current LoRA is an aLoRA.
llama_cpp/llama_cpp.py:2151
Function
llama_adapter_get_alora_n_invocation_tokens
Get the invocation token count if the current LoRA is an aLoRA.
llama_cpp/llama_cpp.py:2138
Function
llama_adapter_lora_free
(adapter: llama_adapter_lora_p, /)
llama_cpp/llama_cpp.py:2128
Function
llama_adapter_lora_init
( model: llama_model_p, path_lora: bytes, / )
llama_cpp/llama_cpp.py:2036
Function
llama_adapter_meta_count
Get the number of adapter metadata key/value pairs.
llama_cpp/llama_cpp.py:2069
Function
llama_adapter_meta_key_by_index
Get adapter metadata key name by index.
llama_cpp/llama_cpp.py:2086
Function
llama_adapter_meta_val_str
Get adapter metadata value as a string by key name.
llama_cpp/llama_cpp.py:2053
Function
llama_adapter_meta_val_str_by_index
Get adapter metadata value as a string by index.
llama_cpp/llama_cpp.py:2109
Function
llama_add_bos_token
(vocab: llama_vocab_p, /)
llama_cpp/llama_cpp.py:3787
Function
llama_add_eos_token
(vocab: llama_vocab_p, /)
llama_cpp/llama_cpp.py:3804
Function
llama_apply_adapter_cvec
( ctx: llama_context_p, data: CtypesPointerOrRef[ctypes.c_float], len: int, n_embd: int, i
llama_cpp/llama_cpp.py:2246
Function
llama_backend_free
Call once at the end of the program - currently only used for MPI
llama_cpp/llama_cpp.py:1314
Function
llama_backend_init
Initialize the llama + ggml backend Call once at the start of the program
llama_cpp/llama_cpp.py:1284
Function
llama_batch_free
Frees a batch of tokens allocated with llama_batch_init()
llama_cpp/llama_cpp.py:3033
Function
llama_batch_get_one
Return batch for single sequence of tokens NOTE: this is a helper function to facilitate transition to the new batch API - avoid using it
llama_cpp/llama_cpp.py:2988
← previous
next →
801–900 of 1,336, ranked by callers