Comments (9)
Edit: left out some relevant parameters and had formatting errors. Corrected now.
from h2ogpt.
Hi,
- I'm supposing the ssl stuff you pass has no effect. So can you remove the ssl args and have the same issue? I don't pass those through so it should have no effect.
i.e. these:
--ssl_verify=False
--ssl_certfile="cert.crt"
--ssl_keyfile="cert.key"
--ssl_keyfile_password="password"
shouldn't matter for the OpenAI proxy.
- As for why uvicorn is asking for ssl certificate and failed, I'm unsure.
You can try editing this line and remove the ssl stuff, just to be sure.
h2ogpt/openai_server/server.py
Line 374 in 88b62f1
- In my case the same message appear but then I get a permission denied:
OpenAI API URL: http://0.0.0.0:1001
INFO:__name__:OpenAI API URL: http://0.0.0.0:1001
OpenAI API key: EMPTY
INFO:__name__:OpenAI API key: EMPTY
[Errno 13] error while attempting to bind on address ('0.0.0.0', 1001): permission denied
Maybe you have something else on that port that is secure? Or maybe the port isn't allowed to be used?
- If I change the port to 5001, then I don't get permission denied.
OpenAI API URL: http://0.0.0.0:5001
INFO:__name__:OpenAI API URL: http://0.0.0.0:5001
OpenAI API key: EMPTY
INFO:__name__:OpenAI API key: EMPTY
Invalid HTTP request received.
INFO: 127.0.0.1:46322 - "GET / HTTP/1.1" 405 Method Not Allowed
INFO: 127.0.0.1:46322 - "GET /favicon.ico HTTP/1.1" 404 Not Found
- Perhaps 1000 and 1001 are too close.
from h2ogpt.
Hi! Thanks for your detailed answer.
- I need the SSL stuff for the main UI. Because of limited VRAM I'd rather not have more H2oGPT-instances than necessary... Is that possible? (To have the main UI via HTTPS and the OpenAI-API via HTTP?
- You mean I could just remove those two parameters, like:
uvicorn.run(app, host=host, port=port)
? - That port is allowed. But I also tried 5001 (with another service on port 5000).
- I'll try another port, too.
from h2ogpt.
I changed
uvicorn.run(app, host=host, port=port, ssl_certfile=ssl_certfile, ssl_keyfile=ssl_keyfile)
to
uvicorn.run(app, host=host, port=port)
and the port from 1001 to 10001, but have the same error...
from h2ogpt.
Maybe there is some ENV that is affecting uvicorn and causing it to trigger SSL. Not sure.
from h2ogpt.
Also, on MAC, I've seen issues with SSL
Needs to be setup right. Are you on MAC or have a proxy?
from h2ogpt.
It's on Ubuntu 22.04, and there is no proxy explicitly set up, nor is the internet connection filtered. But there is a proxy server available which browsers get via the http://gateway/wpad.dat when they're configured to automatically determine the proxy server. I don't know if this plays a role.
Also, I added the intermediate and the root certificate so the verification would work, but it still doesn't.
And, only IPv4 is available, no IPv6 (if that plays a role.)
from h2ogpt.
I spent a few hours now trying to get this to work:
- added the FQDN to /etc/hosts
- set GRADIO_SERVER_HOST=...
- changed the parameters for uvicorn.run, changed host to the FQDN
- made changes to HTTPX
- and some more things,
but I still get:
httpx.ConnectError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'localhost'. (_ssl.c:1007)
Please help, @pseudotensor !
Gradio UI does work with the certificates, just the openai api doesn't.
from h2ogpt.
"localhost" sounds wrong, it should be maybe a real IP address.
In latest h2oGPT what I see in end is:
Running on local URL: http://0.0.0.0:7860
To create a public link, set `share=True` in `launch()`.
Started Gradio Server and/or GUI: server_name: localhost port: None
Use local URL: http://localhost:7860/
/home/jon/miniconda3/envs/h2ogpt/lib/python3.10/site-packages/pydantic/_internal/_fields.py:160: UserWarning: Field "model_info" has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
warnings.warn(
/home/jon/miniconda3/envs/h2ogpt/lib/python3.10/site-packages/pydantic/_internal/_fields.py:160: UserWarning: Field "model_names" has conflict with protected namespace "model_".
You may be able to resolve this warning by setting `model_config['protected_namespaces'] = ()`.
warnings.warn(
OpenAI API URL: http://0.0.0.0:5000
INFO:__name__:OpenAI API URL: http://0.0.0.0:5000
OpenAI API key: EMPTY
INFO:__name__:OpenAI API key: EMPTY
i.e. 0.0.0.0 that for linux means open public version of local IP AFAIK. Maybe you have 'localhost' either using older h2oGPT or are on windows/mac. But you say you are on Ubuntu PC?
When I go to chrome to that IP/Port, it works (the message is valid):
Unfortunately I'm not expert in SSL stuff.
I would recommend trying to setup a fastAPI server, since that is what h2oGPT is doing to get OpenAI proxy server. So do it in very basic form and see what one can do.
E.g. from chatgpt:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
return {"item_id": item_id, "q": q}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
This runs, do you have problems with this? We should be able to bisect the issue if no problem here and still problems with h2oGPT.
from h2ogpt.
Related Issues (20)
- ValueError: load_in_8bit must be a boolean HOT 5
- Question: correct prompts template for llama3-instruct HOT 9
- h2ogpt on ubuntu server HOT 3
- branding capitalization HOT 1
- Support for https://huggingface.co/lightblue/suzume-llama-3-8B-multilingual HOT 3
- OCR issue HOT 1
- shared / personal collections HOT 1
- Failed to initial linux full script intallation HOT 2
- random assertion errors due to evaluate_nochat HOT 13
- Run docker image on any machine which haven't internet connection HOT 19
- h2ogpt vllm-check init-container stuck when istio injection
- GPU offloading mistralai_mistral-7b-instruct-v0.2 HOT 3
- Windows fatal exception: Access violation HOT 3
- Failed to load models HOT 2
- TimeoutError: answer_question_using_context timed out, took more than 60s
- doctr for scanned pdf HOT 6
- pytorch_model.bin 1.34G download hangs forever on Linux HOT 7
- umbrella podSecurityContext null values are always overwritten by sub-chart default values
- [Question] how model learn data from new document ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h2ogpt.