Skip to content

Feature add Add LlamaCppChatCompletionClient and llama-cpp #5326

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 38 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8296259
Add LlamaCppChatCompletionClient and llama-cpp dependency for enhance…
xhabit Feb 2, 2025
8646d54
Merge branch 'main' into main
aribornstein Feb 2, 2025
729133f
Added properly typed completion client and updated init and toml
xhabit Feb 2, 2025
c708cb1
feat: enhance LlamaCppChatCompletionClient with improved initializati…
xhabit Feb 22, 2025
a6ce422
Merge branch 'main' into main
ekzhu Feb 23, 2025
35c2e9f
fix: comment out streaming tests in LlamaCppChatCompletionClient due …
xhabit Feb 23, 2025
f144eb5
Added better handling for tools and not implemented message for images
xhabit Feb 23, 2025
c29ec8a
feat: update create_chat_completion method to accept tools parameter;…
xhabit Feb 23, 2025
35f35ca
feat: add from_pretrained function for model loading; enhance LlamaCp…
xhabit Feb 24, 2025
dfb7471
restoring the proper uv.lock
xhabit Feb 24, 2025
244c775
fix: restore the proper uv.lock file
xhabit Feb 24, 2025
0bad5ce
feat: enhance LlamaCppChatCompletionClient with improved logging and …
xhabit Feb 23, 2025
8159324
fix: update uv.lock and pyproject.toml for llama-cpp-python dependenc…
xhabit Mar 3, 2025
42d6b52
Merge branch 'main' into main
rysweet Mar 4, 2025
7cd7b5e
Merge branch 'main' into main
rysweet Mar 4, 2025
1025669
fix: update installation instructions for llama-cpp dependency; refac…
xhabit Mar 4, 2025
605a691
style: fix formatting and comments in llama_cpp_completion_client and…
xhabit Mar 4, 2025
2c24147
Merge branch 'main' into main
rysweet Mar 5, 2025
8b37132
chore: update uv.lock file to reflect dependency changes
xhabit Mar 6, 2025
3753f30
Merge branch 'main' into main
ekzhu Mar 6, 2025
f5385e3
use uv.lock from main
ekzhu Mar 6, 2025
b20fd4b
fix uv lock
ekzhu Mar 6, 2025
9640729
fix API doc style
ekzhu Mar 6, 2025
61faeb1
Merge branch 'main' into main
rysweet Mar 6, 2025
e80be5f
Merge branch 'main' into main
rysweet Mar 6, 2025
14754ce
Merge branch 'main' into main
rysweet Mar 7, 2025
e9a04c0
refactor llama_cpp client usage examples and add test script
xhabit Mar 10, 2025
8bb2c07
Merge branch 'main' into main
ekzhu Mar 10, 2025
ddd965e
fix uv lock
ekzhu Mar 10, 2025
02dbe9a
fix formatting in api doc
ekzhu Mar 10, 2025
13ecc2c
Don't install all deps for windows pwsh test
ekzhu Mar 10, 2025
1cb962b
fix
ekzhu Mar 10, 2025
d5e549b
minor
ekzhu Mar 10, 2025
8c0ab24
Add llama cpp extras
ekzhu Mar 10, 2025
195d3f9
fix
ekzhu Mar 10, 2025
a651ba3
exclude llama-cpp from windows test
ekzhu Mar 10, 2025
a5e95c7
skip llamacpp tests if not installed
ekzhu Mar 10, 2025
3894793
format
ekzhu Mar 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ jobs:

- name: Install Python deps
run: |
uv sync --locked --all-extras
uv sync --locked --all-extras --no-extra llama-cpp
shell: pwsh
working-directory: ./python

Expand Down
1 change: 1 addition & 0 deletions python/packages/autogen-core/docs/src/reference/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ python/autogen_ext.models.azure
python/autogen_ext.models.anthropic
python/autogen_ext.models.semantic_kernel
python/autogen_ext.models.ollama
python/autogen_ext.models.llama_cpp
python/autogen_ext.tools.code_execution
python/autogen_ext.tools.graphrag
python/autogen_ext.tools.http
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
autogen\_ext.models.llama\_cpp
==============================


.. automodule:: autogen_ext.models.llama_cpp
:members:
:undoc-members:
:show-inheritance:
:member-order: bysource
5 changes: 5 additions & 0 deletions python/packages/autogen-ext/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ file-surfer = [
"autogen-agentchat==0.4.8",
"markitdown~=0.0.1",
]

llama-cpp = [
"llama-cpp-python>=0.1.9",
]

graphrag = ["graphrag>=1.0.1"]
chromadb = ["chromadb"]
web-surfer = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
try:
from ._llama_cpp_completion_client import LlamaCppChatCompletionClient
except ImportError as e:
raise ImportError(
"Dependencies for Llama Cpp not found. "
"Please install llama-cpp-python: "
"pip install autogen-ext[llama-cpp]"
) from e

__all__ = ["LlamaCppChatCompletionClient"]
Loading
Loading