ml-intern icon indicating copy to clipboard operation
ml-intern copied to clipboard

Issue #23 Fix: Use logged in hf token using `huggingface_hub.get_token()` instead of requiring env variable

Open vortezwohl opened this issue 7 months ago • 3 comments

Summary

  • Add a shared Hugging Face token helper that keeps HF_TOKEN as the first local token source and falls back to huggingface_hub.get_token()
  • Reuse the helper in CLI and backend session creation so users logged in with huggingface-cli login do not need to set HF_TOKEN
  • Update the README quick start notes to document the login-cache fallback while keeping the existing environment variable flow

Test plan

  • [x] Run python -m py_compile agent\utils\hf_auth.py agent\main.py backend\routes\agent.py
  • [x] Verify HF_TOKEN takes precedence over huggingface_hub.get_token()
  • [x] Confirm README changes are limited to the HF token setup note

Fixes #23

vortezwohl avatar Apr 18 '26 10:04 vortezwohl

conflict resolved

vortezwohl avatar Apr 24 '26 09:04 vortezwohl

@claude please review this PR. Focus on correctness, security, LiteLLM/Bedrock routing impact, and whether it's safe to merge against current main. Keep it concise and prefer inline comments where it matters.

akseljoonas avatar Apr 24 '26 14:04 akseljoonas

Claude Code is working…

I'll analyze this and get back to you.

View job run

claude[bot] avatar Apr 24 '26 14:04 claude[bot]