Skip to content

Use huggingface_hub.get_token() for auth fallback#126

Open
abidlabs wants to merge 1 commit intohuggingface:mainfrom
abidlabs:hf-token
Open

Use huggingface_hub.get_token() for auth fallback#126
abidlabs wants to merge 1 commit intohuggingface:mainfrom
abidlabs:hf-token

Conversation

@abidlabs
Copy link
Copy Markdown
Member

@abidlabs abidlabs commented Apr 25, 2026

  • add a shared HF router token resolver in agent/core/llm_params.py
  • keep existing precedence (INFERENCE_TOKEN -> session token -> HF_TOKEN) and add a final fallback to huggingface_hub.get_token()
  • update token precedence docs in _resolve_llm_params() so behavior matches implementation

Closes: #23

Let HF router requests resolve credentials from huggingface_hub's local login cache when INFERENCE_TOKEN, session token, and HF_TOKEN are absent. This keeps CLI and plugin flows working after `hf auth login` without requiring explicit env exports.

Made-with: Cursor
@abidlabs abidlabs changed the title Use cached HF login token for router auth fallback Use huggingface_hub.get_token() for auth fallback Apr 25, 2026
@abidlabs abidlabs marked this pull request as ready for review April 25, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use logged in hf token using huggingface_hub.get_token() instead of requiring env variable

1 participant