llama-gemma / patch_auth_test35.py
Leon4gr45's picture
Upload folder using huggingface_hub
a6f8f24 verified
Raw History Blame Contribute Delete
676 Bytes
with open("gateway.py", "r") as f:
code = f.read()
# So `llama-swap` is run WITHOUT `env -u`. It inherits `API_KEY`!
# `llama-swap` therefore expects an API Key for authentication if the environment variable `API_KEY` is present.
# My latest commit sets `llama_auth_headers()` to:
# ```python
# def llama_auth_headers() -> dict[str, str]:
# internal_key = LLAMA_API_KEY or API_KEY
# if internal_key:
# return {"Authorization": f"Bearer {internal_key}"}
# return {}
# ```
# It IS sending `Authorization: Bearer <API_KEY>`!
# Why does `llama-swap` reject it?
# Let's write a python script to hit `llama-swap` directly in the container to figure it out!