microsoft / LLMLingua

To speed up LLMs' inference and enhance LLM's perceive of key information, compress the prompt and KV-Cache, which achieves up to 20x compression with minimal performance loss.
https://llmlingua.com/
MIT License
4.18k stars 222 forks source link

[Question]: Support for Aleph Alpha Luminous Models via API #118

Open ulan-yisaev opened 3 months ago

ulan-yisaev commented 3 months ago

Describe the issue

I propose integrating Aleph Alpha's Luminous models through their API into LLMLingua to address performance concerns with local model execution. Aleph Alpha supports returning logprobs for both prompts and generated text:

https://docs.aleph-alpha.com/api/complete/

**echo**
boolean
Default value: false
Echo the prompt in the completion. This may be especially helpful when log_probs is set to return logprobs for the prompt.

**log_probs**
integer
NULLABLE
Number of top log probabilities for each token generated. Log probabilities can be used in downstream tasks or to assess the model's certainty when producing tokens. No log probabilities are returned if set to None. Log probabilities of generated tokens are returned if set to 0. Log probabilities of generated tokens and top n log probabilities are returned if set to n.

This integration could significantly speed up executions compared to running default models locally, aligning with similar interests shown in issue #70

iofu728 commented 3 months ago

Hi @ulan-yisaev, thank you for your support and information.

We will soon support the use of the Azure API for LLMLingua. Afterwards, we can extend the corresponding endpoint to other platforms. Thank you once again for your information.

ulan-yisaev commented 3 months ago

Hi @iofu728, thank you for your response and the update on supporting Azure API for LLMLingua. To prepare for extending LLMLingua to other platforms, could you please share - if exists - any examples or templates for implementing web-based LLM APIs with LLMLingua? This information would be incredibly helpful as I'm eager to start integrating Aleph Alpha's API in a similar manner for my project.