Skip to content

huggingface/hf-claude

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

hf-claude

extension for hf to launch Claude Code with Hugging Face Inference Providers

It lets you pick:

  • model (from https://router.huggingface.co/v1/models)
  • provider (auto or a concrete provider for the selected model)

Then it runs claude --model <model[:provider]> with the required env vars preconfigured.

Requirements

  • Claude Code CLI installed
  • curl, jq, bash
  • fzf (optional) — enables fuzzy model/provider search; without it the launcher falls back to an arrow-key menu (↑/↓ to move, Enter to select)
  • A Hugging Face token, via either:
curl -LsSf https://hf.co/cli/install.sh | bash
hf auth login        
# or
export HF_TOKEN='hf_...'

Install

hf extensions install hf-claude
# add --force to reinstall the extension

Run

hf claude
# or
hf extensions exec claude

Forward extra args to Claude Code:

hf claude --help
hf extensions exec claude -- --help

Billing to an organization

To bill inference usage to a Hugging Face organization instead of your personal account, pass --bill-to (you must have Write privileges in the org):

hf claude --bill-to your-org-name

This sets the router's X-HF-Bill-To header (via ANTHROPIC_CUSTOM_HEADERS) on every request. You can also set it via the HF_BILL_TO environment variable:

export HF_BILL_TO=your-org-name
hf claude

About

Launch Claude Code with Hugging Face Inference Providers

Resources

Stars

13 stars

Watchers

2 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages