hyperonym / basaran

Basaran is an open-source alternative to the OpenAI text completion API. It provides a compatible streaming API for your Hugging Face Transformers-based text generation models.
MIT License
1.29k stars 80 forks source link

The requested URL was not found on the server #151

Open artivis opened 1 year ago

artivis commented 1 year ago

Hi,

I keep hitting the following error.

InvalidRequestError: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

This happens when trying to droppin' replace OpenAI with basaran (tested with both babyagi and langchain's own implementation of babyagi as a Jupyter notbook). While I had to tweak the former, the later supports setting the api_base since recently.

I did make sure that basaran is running fine, I can hit it with,

curl http://127.0.0.1/v1/completions \
    -H 'Content-Type: application/json' \
    -d '{ "prompt": "once upon a time,", "echo": true }'

Any pointer would be appreciated :)

fardeon commented 1 year ago

I think there might be two possible reasons for the 404 error:

  1. Please make sure api_base is set correctly. Specifically:
api_base
http://127.0.0.1/v1
http://127.0.0.1/v1/
http://127.0.0.1/
  1. Currently, Basaran only supports the completions API, while chat and other features are still a work-in-progress. Please make sure you are not using an unsupported API.
artivis commented 1 year ago
  1. The api_base is indeed set correctly.
  2. I finally could get it to 'work' with babyagi. The call is made and babyagi starts running however it spits a bunch of numbers and crash. I'm not planning to invest more time debugging at this point. As for langchain's babyagi, I still can't get it to work. After digging a bit I do believe it is using the Completion API (openai.Completion).