-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API 404 (Not Found)? #3448
Comments
Looks like a port issue. Did you specify somehow to redirect the request to the port 5000 on the API? |
I am also getting 404 even though I modified the "host" variable to ensure it matches the port as part of the webui. Eg, my webui host is localhost:7860, and as part of the example code, I have HOST = 'localhost:7860'. I print out the response.status_code and get 404. If I put port 5000 where HOST = 'localhost:5000' then I get connection refused error. |
How are you starting the webui? You have to explicitly start the API extension (see #3219 (comment)). |
TheBloke has a runpod template specifically for using the API: |
Not a port issue. Confirmed. I started the WebUI using the -api tag of course, made sure nothing was being blocked, and made sure I can connect to the /api/v1. /api didnt work. |
I don't know how Runpod works (I have a server with two RTX4090 at work). Personnaly I use the oneclick installer and run the options under. webui.py --extension api --loader <the model loader> --model <the model you want to load> --verbose --listen &
# Add your AuthToken
ngrok config add-authtoken <your_auth_token>
ngrok http --domain=<my-ngrok-domain.ngrok-free.app> 5000 Note: it would be better to use I installed the Python Ngrok client using # This is the code I use to do my API request, it needs to be adapted before being
# used in your test client
def api_request(self, request: dict) -> requests.Response:
"""Send a request to OobaBooga.
Args:
request (dict): the request.
Returns:
requests.Response: the response.
"""
request_params = {
# url = "http://127.0.0.1:5000/api/v1/generate"
# or url = "https://dommain.com:443/api/v1/generate"
"url": self.url,
"json": request,
"headers": {"ngrok-skip-browser-warning": "true"},
"timeout": REQUEST_TIMEOUT,
}
# When starting Ngrok you can add basic auth with this flag:
# --basic-auth 'username:password'
if self.basic_auth:
request_params.update(
auth=HTTPBasicAuth(self.username, self.password)
)
return requests.post(**request_params) That way, you can test the webui API endpoint without configuring any port forwarding. If you try to open the Ngrok URL, you will get an error 404: And you will not be able to see it but the server will receive the requests (here I started the webui on my laptop, under Windows, but it's the same behaviour on Linux): |
I currently do not have any Runpod tokens, but I will buy some as soon as possible to test this. Honestly, I think it might be because I forgot the "--listen" parameter, and I'm trying to connect from an external machine. |
I tried it with the listen parameter, and many other variations, i think it might just be the docker version since that what im using and im pretty sure thats what runpod uses. |
Running the api on localhost. I get a response for the
This yields:
When I try the
Any ideas why the |
I have a manually installed ooba version on localhost (M2 Macbookpro) that works perfectly fine, Its my docker install on my lambdalabs server thats broken... both were recently updated. |
@tjb4578 Don't put quotes around True or False. |
Hi @tjb4578, Personally, I use exclusively generate, since I handle the “prompt” and the history myself. Though, be careful with the parameters you are using, for example the parameter |
Thanks this was my issue! |
I've seen multiple people with the same issue (or just testing with my setup) and all of the broken ones are on Docker in particular, no matter the actual container image... weird. |
This issue has been closed due to inactivity for 6 weeks. If you believe it is still relevant, please leave a comment below. You can tag a developer in your comment. |
Describe the bug
Using the API Chat example and Text Generation examples (and correctly configured host/uri endpoints), there is absolutely no output nor generation. Worth noting I am using Runpod for generation.
HTTPS is not enabled on the server. Navigating to the endpoint returns a Not Found error.
Any help is appreciated.
Is there an existing issue for this?
Reproduction
Screenshot
No response
Logs
System Info
The text was updated successfully, but these errors were encountered: