LLM plugin providing access to llama.cpp server models
Project description
llm-llamacpp
A plugin for LLM providing access to models running on a llama.cpp server.
Installation
Install this plugin in the same environment as LLM:
llm install llm-llamacpp-plugin
Setup
First, you need to have a llama.cpp server running. You can start one using the llama.cpp server binary:
# Download and build llama.cpp if you haven't already
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
# Build the server
make
# Start the server with your model
./llama-server -m models/your-model.gguf -c 4096
The server will start on http://localhost:8080 by default.
Usage
Once the plugin is installed and your llama.cpp server is running, you can use it like any other LLM model:
llm -m llamacpp "Your prompt here"
Using a different server URL
If your llama.cpp server is running on a different host or port, you can set the LLM_LLAMACPP_SERVER environment variable:
export LLM_LLAMACPP_SERVER=http://your-server:port
in windows
setx LLM_LLAMACPP_SERVER http://your-server:port
Conversations
You can use conversations just like with other models:
llm -m llamacpp "First message"
llm -c "Follow-up question"
JSON Schema
You can request JSON output using LLM's schema feature:
llm -m llamacpp-tools "Generate a person" --schema '{"name": "string", "age": "integer"}'
Vision Models
If you're running a vision-capable llama.cpp model with multimodal support, the plugin can handle image attachments.
llm -m llamacpp-vision -a /tmp/screen.png "What is the user doing in this screenshot"
Embedding Models
The plugin also supports embedding models running on llama.cpp server. To use embeddings:
# Start the server with embedding support
./llama-server -m models/embedding-model.gguf --embedding
Then use it with LLM:
# Get embeddings for text
llm embed -m llamacpp-embed "Hello world"
# Get embeddings for multiple items
llm embed -m llamacpp-embed "First text" "Second text"
Development
To install the plugin for development:
cd llm-llamacpp
pip install -e .
Run the tests:
pytest
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_llamacpp_plugin-0.1.2.tar.gz.
File metadata
- Download URL: llm_llamacpp_plugin-0.1.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b3d2341a258ba2f39225e5274a58dd69cc0a1b407e15445b130b42b0a1e7078
|
|
| MD5 |
825eafeb2cb400b9a0fe697dfebebc1d
|
|
| BLAKE2b-256 |
e22bdad3be066378643a33a9e45a4b70256b378df65cc99d4a8aa319cd7b33d4
|
Provenance
The following attestation bundles were made for llm_llamacpp_plugin-0.1.2.tar.gz:
Publisher:
publish.yml on sukhbinder/llm-llamacpp-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_llamacpp_plugin-0.1.2.tar.gz -
Subject digest:
8b3d2341a258ba2f39225e5274a58dd69cc0a1b407e15445b130b42b0a1e7078 - Sigstore transparency entry: 1491968747
- Sigstore integration time:
-
Permalink:
sukhbinder/llm-llamacpp-plugin@a0e683fae192ae0eeb94d32d906286f959429312 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/sukhbinder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0e683fae192ae0eeb94d32d906286f959429312 -
Trigger Event:
release
-
Statement type:
File details
Details for the file llm_llamacpp_plugin-0.1.2-py3-none-any.whl.
File metadata
- Download URL: llm_llamacpp_plugin-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9f018d5224e9ebc0a5b4d1fec808e0bd9415d74460764f388e769624423cd06
|
|
| MD5 |
607f870b52b346fcfbc617d1ace9fa0e
|
|
| BLAKE2b-256 |
db4a1e0203343b10ec0f0f9a3698d9b47778ccbbac177d542f99b31c0e1c1c4b
|
Provenance
The following attestation bundles were made for llm_llamacpp_plugin-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on sukhbinder/llm-llamacpp-plugin
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_llamacpp_plugin-0.1.2-py3-none-any.whl -
Subject digest:
b9f018d5224e9ebc0a5b4d1fec808e0bd9415d74460764f388e769624423cd06 - Sigstore transparency entry: 1491968878
- Sigstore integration time:
-
Permalink:
sukhbinder/llm-llamacpp-plugin@a0e683fae192ae0eeb94d32d906286f959429312 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/sukhbinder
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a0e683fae192ae0eeb94d32d906286f959429312 -
Trigger Event:
release
-
Statement type: