Feature Request: SuperCompress prompt preprocessing for llama-cpp-python

オープン
#2,326 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
python
領域
ai, backend

調査の方向性

Start with the README or examples for llama-cpp-python and inspect how examples call llama.create_completion(). Add an example that compresses a prompt with SuperCompress before passing it to the completion call, following the integration shown in the issue. Done when the example demonstrates the compression flow and can be followed by users with both packages installed.

索引モデルが issue の本文から書いたものです。

説明

Feature: Prompt Compression for llama-cpp-python

Problem: llama-cpp-python users often work with local models that have limited context (2048-4096 tokens). Long prompts waste valuable context window space.

Proposed Solution: Provide a SuperCompress integration example that compresses prompts before passing them to llama.create_completion().

from supercompress import Compressor
from llama_cpp import Llama

compressor = Compressor()
llm = Llama(model_path="./model.gguf")

compressed_prompt = compressor.compress(long_prompt, query)
output = llm.create_completion(compressed_prompt)

Benefits:

主要言語
Python
スター
10.7k
フォーク
1.5k
平均マージ
1時間 40分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

abetlen/llama-cpp-python のほかの issue

abetlen/llama-cpp-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。