Skip to content

Add HF_HUB_USER_AGENT_ORIGIN #534

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 26, 2025
Merged

Add HF_HUB_USER_AGENT_ORIGIN #534

merged 3 commits into from
Mar 26, 2025

Conversation

alvarobartt
Copy link
Member

What does this PR do?

This PR adds the HF_HUB_USER_AGENT_ORIGIN environment variable within the request headers when sending requests to the Hugging Face Hub, useful for a better tracking of the different partnership integrations. To achieve that, this PR also bumps hf-hub so that the header is properly handled in the hf-hub crate, and also drops the online feature not needed anymore (as dropped within hf-hub).

The main effort / kudos for this PR go to @Hugoch as he created the header-handling and a similar PR for TGI (see huggingface/text-generation-inference#3027 and huggingface/text-generation-inference#3061).

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline, Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the documentation guidelines, and here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

@Narsil, @McPatate or @Hugoch

- Handles `HF_HUB_USER_AGENT_ORIGIN`
- Drops the `online` feature
@alvarobartt alvarobartt requested a review from Hugoch March 26, 2025 08:56
Copy link
Member

@Hugoch Hugoch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@Narsil Narsil merged commit 7f0e261 into main Mar 26, 2025
13 checks passed
@Narsil Narsil deleted the add-user-agent branch March 26, 2025 14:49
alvarobartt added a commit to alvarobartt/llm-hosting-container that referenced this pull request Apr 7, 2025
varunmoris added a commit to awslabs/llm-hosting-container that referenced this pull request Apr 30, 2025
* Add `huggingface/pytorch/tei/docker/1.6.1`

* Update `releases.json`

* Apply suggestions from code review

Co-Authored-by: Florent Gbelidji <[email protected]>

* Add `HF_HUB_USER_AGENT_ORIGIN`

Introduced in
huggingface/text-embeddings-inference#534

* Fix spacing in `Dockerfile` for CPU

* Add `start-cuda-compat.sh` and copy in `Dockerfile`

* Update `README.md`

* Add `start-cuda-compat.sh`

* Rename 1.6.1 to 1.7.0 (just released)

* Update `Dockerfile` for CPU

* Update `Dockerfile` for GPU

* Run `ruff`

* Add `subprocess` to update submodules

* Add `libgssapi-krb5-2` to patch CVE

Apparently only required for GPU builds

* Fix path to `start-cuda-compat.sh` in `Dockerfile`

---------

Co-authored-by: Florent Gbelidji <[email protected]>
Co-authored-by: varunmoris <[email protected]>
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.

3 participants