Skip to content
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

Feature add Add LlamaCppChatCompletionClient and llama-cpp #5326

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

aribornstein
Copy link

@aribornstein aribornstein commented Feb 2, 2025

This pull request introduces the integration of the llama-cpp library into the autogen-ext package, with significant changes to the project dependencies and the implementation of a new chat completion client. The most important changes include updating the project dependencies, adding a new module for the LlamaCppChatCompletionClient, and implementing the client with various functionalities.

Project Dependencies:

New Module:

Implementation of LlamaCppChatCompletionClient:

  • python/packages/autogen-ext/src/autogen_ext/models/llama_cpp/_llama_cpp_completion_client.py:
    • Added the LlamaCppChatCompletionClient class with methods to initialize the client, create chat completions, detect and execute tools, and handle streaming responses.
    • Included detailed logging for debugging purposes and implemented methods to count tokens, track usage, and provide model information.…d chat capabilities

Why are these changes needed?

Related issue number

Checks

Copy link

codecov bot commented Feb 2, 2025

Codecov Report

Attention: Patch coverage is 76.40449% with 42 lines in your changes missing coverage. Please review.

Project coverage is 75.59%. Comparing base (7d17ac8) to head (9640729).

Files with missing lines Patch % Lines
...t/models/llama_cpp/_llama_cpp_completion_client.py 76.87% 40 Missing ⚠️
...n-ext/src/autogen_ext/models/llama_cpp/__init__.py 60.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #5326    +/-   ##
========================================
  Coverage   75.59%   75.59%            
========================================
  Files         189      191     +2     
  Lines       12672    12850   +178     
========================================
+ Hits         9579     9714   +135     
- Misses       3093     3136    +43     
Flag Coverage Δ
unittests 75.59% <76.40%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aribornstein
Copy link
Author

Will be working on this today.

…on and error handling; add unit tests for functionality
@aribornstein
Copy link
Author

@ekzhu I completed the tests please have another look

@aribornstein
Copy link
Author

@microsoft-github-policy-service agree company="Microsoft"

@microsoft-github-policy-service agree company="Microsoft"

Copy link
Collaborator

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of smaller change set, let's focus on create and raise NoteImplementedError in create_stream.

Copy link
Collaborator

@ekzhu ekzhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I think there are more work needed for this PR to be ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants