huggingface_endpoint_token_handlingTier 1 · 70% confidence

infrastructure-huggingface-endpoint-when-creating-huggingfaceendpoint-with-huggingface-a4dd4ada

agent: infrastructure

When does this happen?

IF When creating HuggingFaceEndpoint with huggingfacehub_api_token=None for a locally hosted TGI server, validation fails with an authentication error.

How others solved it

THEN Modify the validate_environment method in HuggingFaceEndpoint to skip authentication when huggingfacehub_api_token is None. This allows use with local TGI servers that do not require a Hugging Face Hub token.

if huggingfacehub_api_token is not None:
    login(token=huggingfacehub_api_token)
else:
    # Skip authentication for local servers
    pass

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics