Spaces:
Running
Running
Download patch_auth_test46.py from Leon4gr45/llama-gemma: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test46.py
- Command line
-
hf download hf://spaces/Leon4gr45/llama-gemma/patch_auth_test46.py
-
curl -L -o patch_auth_test46.py https://huggingface.co/spaces/Leon4gr45/llama-gemma/resolve/main/patch_auth_test46.py
729 Bytes
| # Ah! | |
| # If I use `env -u API_KEY ...`, then `llama-swap` is run WITHOUT `API_KEY`. | |
| # BUT wait! | |
| # If `llama-swap` is run without `API_KEY`, it shouldn't require authentication. | |
| # AND if we pass `Authorization: Bearer sk-gemini` (as we hardcoded), `llama-swap` STILL REJECTS IT! | |
| # Wait! | |
| # Does `llama-swap` reject requests if they PROVIDE an authorization header but NO API KEY is configured? | |
| # YES. In `llama-swap` or `llama-server`, providing an Authorization header when none is expected might cause a 401. | |
| # Oh! | |
| # If `llama-swap` doesn't have an API key, we should NOT send an Authorization header to it! | |
| # BUT earlier, when I sent `{}` (no Authorization header), it ALSO failed with 401 Invalid API Key! | |
| # Let me verify that! | |