2023-06-27 16:45:31 +00:00
|
|
|
---
|
|
|
|
title: API Reference
|
|
|
|
---
|
|
|
|
|
2023-11-23 04:45:02 +00:00
|
|
|
## High Level API
|
|
|
|
|
2023-11-27 23:42:15 +00:00
|
|
|
High-level Python bindings for llama.cpp.
|
|
|
|
|
2023-06-27 16:45:31 +00:00
|
|
|
::: llama_cpp.Llama
|
|
|
|
options:
|
|
|
|
members:
|
|
|
|
- __init__
|
|
|
|
- tokenize
|
|
|
|
- detokenize
|
|
|
|
- reset
|
|
|
|
- eval
|
|
|
|
- sample
|
|
|
|
- generate
|
|
|
|
- create_embedding
|
|
|
|
- embed
|
|
|
|
- create_completion
|
|
|
|
- __call__
|
|
|
|
- create_chat_completion
|
2024-02-21 21:26:49 +00:00
|
|
|
- create_chat_completion_openai_v1
|
2023-06-27 16:45:31 +00:00
|
|
|
- set_cache
|
|
|
|
- save_state
|
|
|
|
- load_state
|
|
|
|
- token_bos
|
|
|
|
- token_eos
|
2024-02-21 21:25:10 +00:00
|
|
|
- from_pretrained
|
2023-06-27 16:45:31 +00:00
|
|
|
show_root_heading: true
|
|
|
|
|
2023-11-23 05:27:41 +00:00
|
|
|
::: llama_cpp.LlamaGrammar
|
|
|
|
options:
|
|
|
|
members:
|
|
|
|
- from_string
|
|
|
|
- from_json_schema
|
|
|
|
|
2023-06-27 16:45:31 +00:00
|
|
|
::: llama_cpp.LlamaCache
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
|
|
|
::: llama_cpp.LlamaState
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
2023-06-29 01:07:58 +00:00
|
|
|
::: llama_cpp.LogitsProcessor
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
|
|
|
::: llama_cpp.LogitsProcessorList
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
|
|
|
::: llama_cpp.StoppingCriteria
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
|
|
|
::: llama_cpp.StoppingCriteriaList
|
|
|
|
options:
|
|
|
|
show_root_heading: true
|
|
|
|
|
2023-11-23 04:45:02 +00:00
|
|
|
## Low Level API
|
|
|
|
|
2023-11-27 23:42:15 +00:00
|
|
|
Low-level Python bindings for llama.cpp using Python's ctypes library.
|
|
|
|
|
2023-11-23 04:45:02 +00:00
|
|
|
::: llama_cpp.llama_cpp
|
|
|
|
options:
|
|
|
|
show_if_no_docstring: true
|
|
|
|
# filter only members starting with `llama_`
|
|
|
|
filters:
|
|
|
|
- "^llama_"
|
|
|
|
|
2023-06-27 16:45:31 +00:00
|
|
|
::: llama_cpp.llama_cpp
|
|
|
|
options:
|
2023-11-23 04:45:02 +00:00
|
|
|
show_if_no_docstring: true
|
|
|
|
show_root_heading: false
|
|
|
|
show_root_toc_entry: false
|
|
|
|
heading_level: 4
|
|
|
|
# filter only members starting with `LLAMA_`
|
|
|
|
filters:
|
|
|
|
- "^LLAMA_"
|
2023-11-23 05:27:41 +00:00
|
|
|
|
|
|
|
## Misc
|
|
|
|
|
|
|
|
::: llama_cpp.llama_types
|
|
|
|
options:
|
|
|
|
show_if_no_docstring: true
|