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 Request: introduce Tool Call API in server mode #9031

Closed
4 tasks done
tybalex opened this issue Aug 14, 2024 · 5 comments · May be fixed by #9254
Closed
4 tasks done

Feature Request: introduce Tool Call API in server mode #9031

tybalex opened this issue Aug 14, 2024 · 5 comments · May be fixed by #9254
Labels
enhancement New feature or request stale

Comments

@tybalex
Copy link

tybalex commented Aug 14, 2024

Prerequisites

  • I am running the latest code. Mention the version if possible as well.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • I reviewed the Discussions, and have a new and useful enhancement to share.

Feature Description

In the server mode, user should be able to use the OAI api for tool calling just like they do to do tool calling for gpt-4. Today this is not supported yet: https://github.com/ggerganov/llama.cpp/blob/master/examples/server/utils.hpp#L394

Motivation

There are more and more open sourced small models(7b, 30b, 70b) out there that support tool calling. Is it possible that llama.cpp starts to support those? I also created my own tool calling models: https://huggingface.co/rubra-ai/Meta-Llama-3-8B-Instruct-GGUF, but it requires extra preprocess and post process steps to handle the function calling requests, so I have to create a fork tools.cpp and implemented custom logic.

I wonder if it is possible to create something like a standard tool calling template so that tool calling models can follow. Basically it needs to cover 3 things:

  1. convert tool calling output from model to OAI json format.
  2. convert OAI format input function definitions to proper system prompt of local model.
  3. convert OAI format input chat messages with role tool_call or tools to a proper format that a tool calling model can support.

Possible Implementation

No response

@tybalex tybalex added the enhancement New feature or request label Aug 14, 2024
@qnixsynapse
Copy link
Contributor

cc: @ngxson

@ngxson
Copy link
Collaborator

ngxson commented Aug 16, 2024

Tool calls is not just a chat template, so it's trivial to implement. The problem is that it must be done per model. I think we can base on the same infrastructure provided by #5695

@segmond
Copy link

segmond commented Aug 27, 2024

tool call is no longer optional or a fancy thing to have. An LLM without tool calling is not as useful. I look forward to this.

@crashr
Copy link
Contributor

crashr commented Aug 28, 2024

Exactly what @segmond wrote.

Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants