llama.cpp Guidance
The llama-cpp-guidance package provides an LLM client compatibility layer between llama-cpp-python and guidance.
Installation
The llama-cpp-guidance package can be installed using pip.
pip install llama-cpp-guidance
⚠️ It is highly recommended that you follow the installation instructions for llama-cpp-python after installing llama-cpp-guidance to ensure that you have hardware acceleration setup appropriately.
Basic Usage
Once installed, you can use the LlamaCpp class like any other guidance-compatible LLM class.
from pathlib import Path
from llama_cpp_guidance.llm import LlamaCpp
import guidance
guidance.llm = LlamaCpp(
model_path=Path("../path/to/llamacpp/model.gguf"),
n_gpu_layers=1,
n_threads=8
)
program = guidance(
"The best thing about the beach is {{~gen 'best' temperature=0.7 max_tokens=10}}"
)
output = program()
print(output)
The best thing about the beach is that there’s always something to do.
Metadata
Release files for llama-cpp-guidance 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llama_cpp_guidance-0.1.2.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llama_cpp_guidance-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / llama_cpp_guidance-0.1.2.tar.gz
| Download URL | llama_cpp_guidance-0.1.2.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
903f34c2052904646b0f0f4f257a784801089eb5faca1804f006fac1e8b786d2
|
|
BLAKE2b-256 checksum How to use checksums |
5b4bf0e2391be107c9e826f0e187e9b03958380ff726e6131e5b32463b43ca0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / llama_cpp_guidance-0.1.2-py3-none-any.whl
| Download URL | llama_cpp_guidance-0.1.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
48808ea69536fcea314c3bb270a61fc7349552fba511febca11b5c2c03d85576
|
|
BLAKE2b-256 checksum How to use checksums |
026e9938266b0cd737942f4b5683f1b239364e292a37901b82ab10d00cc6cddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|