defenseunicorns / leapfrogai

Production-ready Generative AI for local, cloud native, airgap, and edge deployments.
https://leapfrog.ai
Apache License 2.0
249 stars 26 forks source link

feat: token counting endpoint #281

Open gphorvath opened 5 months ago

gphorvath commented 5 months ago

Type: Feature

Description: Enhance the API to allow users to count tokens for text, so that prompts can be cut off at accurate points for a local LLM.

User Story: As an API user, I want the ability to count tokens for a given text input, so that I can accurately truncate prompts at specific token counts when working with a local Language Model (LLM).

Acceptance Criteria:

CollectiveUnicorn commented 3 months ago

Putting this on hold again, the token count will be returned by the completion API as a part of https://github.com/defenseunicorns/leapfrogai/pull/493 but there won't be another endpoint for the just counting just yet.