ViperX7 / Alpaca-Turbo

Web UI to run alpaca model locally
GNU Affero General Public License v3.0
877 stars 92 forks source link

New API using a standard, fastAPI, and Uvicorn #16

Closed alexanderatallah closed 1 year ago

alexanderatallah commented 1 year ago

The schema for this API is based on OpenAI's api: https://platform.openai.com/docs/api-reference/completions/create

Standardizing the API allows apps to be built on top of it, already knowing how to talk to Alpaca.

Includes autogenerated docs:

Screenshot 2023-03-24 at 3 31 46 PM

Discussion on a standard is here, but i should move it to github: https://www.notion.so/alexatallah/RFC-LLM-API-Standard-c8f15d24bd2f4ab98b656f08cdc1c4fb?pvs=4

Showgofar commented 1 year ago

can you please provide more info what is format of json data for api please give any sample request Thank you)

Showgofar commented 1 year ago

I had tried $data=array
( "model"=> "ggml-alpaca-7b-q4.bin", "prompt"=> $text, "max_tokens"=> 7, "temperature"=> 0.5, "top_p"=> 1, "n"=> 1, "stream"=> false, "logprobs"=> null, "stop"=> "\n" ); but its doesn't return anything