Whisper icon indicating copy to clipboard operation
Whisper copied to clipboard

Request for REST API

Open zwilch opened this issue 2 years ago • 4 comments

I use it under Windows because it works really well with my AMD GPU and requires less resources (RAM). Therefore, following question - is there a possibility to invoke it as a service through a REST API so that it can be bound with nginx?

zwilch avatar Jul 24 '23 12:07 zwilch

This leaves so many questions open... there will never be one webservice implementation that serves a general purpose. What exactly is your goal? Did you check out the existing OpenAI or deepspeech offerings and make some calculations and try to find out if it can pay off to host your own API Service?

emcodem avatar Jul 27 '23 15:07 emcodem

This tool "Const-me/Whisper" is very resource-efficient (in terms of RAM), which concerns my computer's resources. I would prefer an integration via NodeJS. In essence, I only need the capability to send a PCM audio snippet to Const-me/Whisper through an API and receive the text as a response. Possibly, the language or translation might need to be specified as a parameter. I don't really expect more than that. I've looked into the Python Whisper implementations, but I quickly reach the limits of the hardware available to me.

zwilch avatar Aug 07 '23 11:08 zwilch

Sorry but i did not ask if you looked into python projects but into the offerings of e.g. openai themselves, e.g. the API's they provide: https://openai.com/pricing - $0.006 per minute will be pretty hard to beat, it might be less than only the power consumption is for your self hosted service.

I've looked into the Python Whisper implementations, but I quickly reach the limits of the hardware available to me.

Maybe you want to look into faster-whisper python implementation, they don't need more memory than this repo does as far as i am aware of.

I would prefer an integration via NodeJS. In essence, I only need the capability to send a PCM audio snippet to Const-me/Whisper through an API and receive the text as a response.

Overall your ask is definitely at the wrong place here. I assume that because this repo is so far a low-level demo and API for windows dedicated developers using C#, C++ and similar. Especially webserverdoes not really belong to any strengths of these OS/languages. You can easily use nodejs, php and others to write a webservice for accepting PCM data as file upload, construct a wav file and call the existing main.exe commandline example tool. Then you just return the response text. If you design your service like this, it is even compatible to exchange the used whisper inference at any time. Such stuff is the type of application you can nowdays just ask chatgpt to write for you ^^

emcodem avatar Aug 07 '23 17:08 emcodem

I developed a service called whisper-api-server using the go bindings by jaybinks. It allows you to invoke the functionality as a service through a simple API and can be easily integrated with nginx I think. Feel free to utilize it for your purposes!

xzeldon avatar Oct 05 '23 21:10 xzeldon