llama-gemma / patch_auth_test5.py
Leon4gr45's picture
Upload folder using huggingface_hub
50aaad6 verified
Raw History Blame Contribute Delete
839 Bytes
with open("gateway.py", "r") as f:
code = f.read()
# Wait, does llama-swap itself require an API key?
# llama-swap docs say:
# "It passes requests matching /v1/models and /v1/chat/completions to the appropriate model..."
# Does llama-swap pass the Authorization header it receives down to the model?
# Yes.
# Does llama-swap validate the API key?
# Maybe llama-swap passes the Authorization header to the model, and the model (llama-server) validates it?
# Yes! And because I hit the API with `Authorization: Bearer optional_key`, the request hit gateway.py, which called:
# `client.post(..., headers=llama_auth_headers())`
# Wait, if `llama_auth_headers()` is `{}`, then `httpx` sends NO Authorization header!
# But then why does `llama-server` complain about Invalid API Key?
# Let's print out what `LLAMA_API_KEY` is in the space.