MCPcopy Create free account

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

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

↓ 303 callersMethodappend
(self, elem)
examples/low_level_api/util.py:38
↓ 62 callersMethodencode
(self, batch: LlamaBatch)
llama_cpp/_internals.py:334
↓ 36 callersMethodextend
( self, sequence_id: int, tokens: Sequence[int], )
examples/server/server.py:878
↓ 35 callersFunction_warn_deprecated
(symbol: str, hint: str)
llama_cpp/llama_cpp.py:48
↓ 31 callersMethoddecode
(self, batch: LlamaBatch)
llama_cpp/_internals.py:326
↓ 31 callersMethoddetokenize
Detokenize a list of tokens. Args: tokens: The list of tokens to detokenize. prev_tokens: The list of previous tokens
llama_cpp/llama.py:613
↓ 29 callersMethodcreate_completion
Generate text from a prompt. Args: prompt: The prompt to generate text from. suffix: A suffix to append to the genera
llama_cpp/llama.py:1808
↓ 28 callersMethodfrom_string
(cls, grammar: str, verbose: bool = True)
llama_cpp/llama_grammar.py:25
↓ 22 callersFunction_map_roles
Map the message roles.
llama_cpp/llama_chat_format.py:886
↓ 21 callersMethod_response_event
( state: "OpenAIFormatter.ResponsesStream", event_type: str, **payload: Any, )
examples/server/server.py:9127
↓ 21 callersMethodcopy
(self, source_sequence_id: int, dest_sequence_id: int, keep_len: int)
examples/server/server.py:964
↓ 20 callersMethod_add_rule
(self, name, rule)
llama_cpp/llama_grammar.py:424
↓ 20 callersMethodformat
( self, *, messages: List[ChatCompletionRequestMessage], media_marker: Optiona
examples/server/server.py:3679
↓ 20 callersMethodtokenize
Tokenize a string. Args: text: The utf-8 encoded string to tokenize. add_bos: Whether to add a beginning of sequence
llama_cpp/llama.py:595
↓ 19 callersMethod_add_rule
(self, name: str, rule: str)
examples/server/server.py:314
↓ 19 callersMethoddecode
(self)
examples/server/server.py:12161
↓ 16 callersFunction_get_system_message
Get the first system message.
llama_cpp/llama_chat_format.py:876
↓ 14 callersMethodfrom_pretrained
Create a Llama model from a pretrained model name or path. This method requires the huggingface-hub package. You can install it with `
llama_cpp/llama.py:2316
↓ 13 callersFunction_convert_text_completion_logprobs_to_chat
( logprobs: Optional[llama_types.CompletionLogprobs], )
llama_cpp/llama_chat_format.py:306
↓ 12 callersMethod_regex_literal_prefix
(pattern: str)
examples/server/server.py:4524
↓ 11 callersMethoddecode_text
(data: bytes)
examples/server/server.py:7851
↓ 10 callersFunction_create_test_model
(model_path)
tests/test_llama.py:351
↓ 10 callersMethod_set_batch_embedding_row
( self, row: int, embedding: Union[np.ndarray, ctypes.POINTER(ctypes.c_float)], )
examples/server/server.py:1414
↓ 10 callersFunctioncreate_completion
(prompt, stop, grammar)
llama_cpp/llama_chat_format.py:2108
↓ 10 callersMethodtoken_bos
Return the beginning-of-sequence token.
llama_cpp/llama.py:2268
↓ 10 callersMethodtoken_eos
Return the end-of-sequence token.
llama_cpp/llama.py:2264
↓ 9 callersMethod_add_batch_token
( self, *, token: int, pos: int, seq_id: int, logits: bool,
examples/server/server.py:1429
↓ 9 callersMethod_chat_message
(data: Dict[str, Any])
examples/server/server.py:7926
↓ 9 callersMethod_clear_batch
(self)
examples/server/server.py:1408
↓ 9 callersMethod_consume_until_literal
( cls, text: str, literal: str, )
examples/server/server.py:4741
↓ 9 callersMethodn_ctx
Return the context window size.
llama_cpp/llama.py:2248
↓ 8 callersFunction_convert_completion_to_chat
( completion_or_chunks: Union[ llama_types.CreateCompletionResponse, Iterator[llama_types.
llama_cpp/llama_chat_format.py:406
↓ 8 callersMethod_tokenize
(self, prompt, bos=True)
examples/low_level_api/low_level_api_chat_cpp.py:317
↓ 8 callersMethodclose
(self)
examples/server/server.py:11812
↓ 8 callersMethodfrom_json_schema
(cls, json_schema: str, verbose: bool = True)
llama_cpp/llama_grammar.py:46
↓ 8 callersMethodreset
Reset the model state.
llama_cpp/llama.py:649
↓ 8 callersMethodtruncate
(self, seq_id: int, keep_len: int)
examples/server/server.py:2398
↓ 7 callersMethod_chunk_payloads
( self, *, chunk_id: str, created: int, model: str, deltas: Li
examples/server/server.py:7613
↓ 7 callersMethod_primitive_rules
(cls)
examples/server/server.py:219
↓ 7 callersFunctionbad_request
(exc: CompletionRequestValidationError)
examples/server/server.py:15767
↓ 7 callersMethodeval
Evaluate a list of tokens. Args: tokens: The list of tokens to evaluate.
llama_cpp/llama.py:659
↓ 7 callersMethodtokenize
( self, text: str, *, add_bos: bool = True, special: bool = True,
examples/server/server.py:11934
↓ 7 callersMethodtruncate_draft_sequence
(self, seq_id: int, keep_len: int)
examples/server/server.py:12184
↓ 6 callersMethod_add_primitive
(self, name: str, rule: BuiltinRule)
llama_cpp/llama_grammar.py:846
↓ 6 callersMethod_add_primitive
(self, name: str, rule: "JsonSchemaConverter.BuiltinRule")
examples/server/server.py:665
↓ 6 callersFunction_format_no_colon_single
Format the prompt with the no-colon-single style.
llama_cpp/llama_chat_format.py:946
↓ 6 callersFunction_generate_test_tokens
(model, tokens, max_tokens=3)
tests/test_llama.py:364
↓ 6 callersMethod_pending_tokens_length
( self, source: Union[CompletionRequest, Completion], )
examples/server/server.py:13764
↓ 6 callersMethod_sample_token
(self, output_index: int = 0, *, seq_id: int = 0)
examples/server/server.py:1374
↓ 6 callersMethod_try_decode_batch
(self)
examples/server/server.py:1447
↓ 6 callersMethodclaim_unused_sequence
(self)
examples/server/server.py:14958
↓ 6 callersMethoddetokenize
(self, tokens: Sequence[int])
examples/server/server.py:12040
↓ 6 callersMethodfingerprint_file
(path: str)
examples/server/server.py:12360
↓ 6 callersMethodfrom_logits
( cls, *, model: Model, formatter: OpenAIFormatter, prev_tokens: Seque
examples/server/server.py:3750
↓ 6 callersFunctionget_grammar
(function_call)
llama_cpp/llama_chat_format.py:2075
↓ 6 callersMethodlogits
(self, output_index: int)
examples/server/server.py:12198
↓ 6 callersMethodset_color
(self, c)
examples/low_level_api/low_level_api_chat_cpp.py:330
↓ 5 callersFunction_format_add_colon_single
Format the prompt with the add-colon-single style.
llama_cpp/llama_chat_format.py:919
↓ 5 callersFunction_format_chatml
Format the prompt with the chatml style.
llama_cpp/llama_chat_format.py:972
↓ 5 callersMethod_regex_literal_prefix_and_remainder
(pattern: str)
examples/server/server.py:4529
↓ 5 callersMethod_set_nextn_layer_offset
(self, offset: int)
examples/server/server.py:1461
↓ 5 callersMethodcancel
()
examples/server/server.py:15595
↓ 5 callersMethodclamp_to_reusable_boundary
(self, pos: int)
examples/server/server.py:3983
↓ 5 callersMethodclear_batch
(self)
examples/server/server.py:12079
↓ 5 callersMethodclose
Explicitly free the model from memory.
llama_cpp/llama.py:2280
↓ 5 callersMethodembed
Embed a string. Args: input: The utf-8 encoded string to embed. Returns: A list of embeddings
llama_cpp/llama.py:1060
↓ 5 callersFunctionenv_or_def
(env, default)
examples/low_level_api/Miku.py:7
↓ 5 callersFunctionenv_or_def
(env, default)
examples/low_level_api/Chat.py:7
↓ 5 callersMethodfail_request
(self, request: CompletionRequest, exc: BaseException)
examples/server/server.py:14998
↓ 5 callersMethodfail_sequence_cache_load
( self, request: CompletionRequest, seq_id: int, )
examples/server/server.py:13223
↓ 5 callersMethodfrom_token
( cls, *, model: Model, prev_tokens: Sequence[int], prev_text_bytes: O
examples/server/server.py:3730
↓ 5 callersFunctiongenerate_schema_from_functions
(functions, namespace="functions")
llama_cpp/llama_chat_format.py:1541
↓ 5 callersMethodget_tensor
(self, name: str)
llama_cpp/_internals.py:117
↓ 5 callersMethodhandle_completion_token
( self, completion: Completion, token: int, record: Token, *,
examples/server/server.py:14777
↓ 5 callersMethodis_idle
(self)
examples/server/server.py:13353
↓ 5 callersMethodkv_cache_clear
(self)
llama_cpp/_internals.py:292
↓ 5 callersMethodrequire_decode
(self)
examples/server/server.py:13003
↓ 5 callersMethodtruncate_sequence
( self, seq_id: int, keep_len: int, *, truncate_draft: bool = True,
examples/server/server.py:14861
↓ 5 callersMethodvisit
(n: dict)
llama_cpp/llama_grammar.py:446
↓ 5 callersMethodvisit
(node: Any)
examples/server/server.py:330
↓ 4 callersFunction_build_repetition
( item_rule, min_items, max_items, separator_rule=None, item_rule_is_literal=False )
llama_cpp/llama_grammar.py:254
↓ 4 callersMethod_build_repetition
( item_rule: str, min_items: int, max_items: Optional[int], separator_rule: Op
examples/server/server.py:167
↓ 4 callersFunction_convert_completion_to_chat_function
( tool_name: str, completion_or_chunks: Union[ llama_types.CreateCompletionResponse, I
llama_cpp/llama_chat_format.py:425
↓ 4 callersMethod_current_prompt_segment
(self, request: CompletionRequest)
examples/server/server.py:13761
↓ 4 callersMethod_decode_batch
(self)
examples/server/server.py:1472
↓ 4 callersMethod_download_repo_file
(self, repo_file: str)
examples/server/server.py:3206
↓ 4 callersMethod_free_lora_adapters
(self)
examples/server/server.py:11805
↓ 4 callersFunction_grammar_for_response_format
( response_format: llama_types.ChatCompletionRequestResponseFormat, verbose: bool = False, )
llama_cpp/llama_chat_format.py:1018
↓ 4 callersMethod_parsed_chat_message
( self, *, parsed: Dict[str, Any], partial: bool = False, )
examples/server/server.py:7366
↓ 4 callersMethod_pending_sequence_id
( self, source: Union[CompletionRequest, Completion], )
examples/server/server.py:13751
↓ 4 callersMethod_recurrent_draft_batch_token_count
( self, source: Union[CompletionRequest, Completion], )
examples/server/server.py:13664
↓ 4 callersMethod_reset_sampler
(self, seq_id: int)
examples/server/server.py:1385
↓ 4 callersMethod_response_text_from_content
(content: Any)
examples/server/server.py:7945
↓ 4 callersMethod_string_format_rules
(cls)
examples/server/server.py:262
↓ 4 callersMethodaccept_draft_tokens
(self, seq_id: int, accepted_draft_tokens: int)
examples/server/server.py:12180
↓ 4 callersMethodattention_kv_required
( prompt_kv: int, reused_kv: int, generation_kv: int, )
examples/server/server.py:12636
↓ 4 callersFunctionchat_formatter_to_chat_completion_handler
( chat_formatter: ChatFormatter, )
llama_cpp/llama_chat_format.py:610
↓ 4 callersMethodclear_memory
(self)
examples/server/server.py:12084
↓ 4 callersMethodclose
(self)
llama_cpp/_internals.py:80
↓ 4 callersMethodcopy_sequence_state
( self, source_sequence_id: int, dest_sequence_id: int, keep_len: int,
examples/server/server.py:14880
next →1–100 of 1,336, ranked by callers