Skip to content

feat(huggingface): add text generation provider#183

Merged
Kamilbenkirane merged 3 commits intomainfrom
provider/huggingface-text-generation
Feb 24, 2026
Merged

feat(huggingface): add text generation provider#183
Kamilbenkirane merged 3 commits intomainfrom
provider/huggingface-text-generation

Conversation

@Kamilbenkirane
Copy link
Member

Summary

  • Add HuggingFace as a text generation provider via their OpenAI-compatible inference router (router.huggingface.co)
  • 127+ models across 15 inference providers (Cerebras, Groq, Together, SambaNova, etc.)
  • Follows the ChatCompletionsClient pattern (same as Groq/DeepSeek)
  • Rename credential from HUGGINGFACE_TOKENHF_TOKEN to match HuggingFace's official env var
  • Register 2 cheap models for integration test coverage (Qwen/Qwen3-4B-Instruct-2507, google/gemma-3n-E4B-it)

Changes

New files (11): Provider layer (src/celeste/providers/huggingface/) + modality layer (src/celeste/modalities/text/providers/huggingface/)

Modified files (5): credentials.py, .env.example, providers/__init__.py, text providers/__init__.py, text models.py

Test plan

  • Unit tests: 476 passed
  • Integration test: test_stream_generate[huggingface-Qwen/Qwen3-4B-Instruct-2507] passed
  • Integration test: test_stream_analyze[huggingface-google/gemma-3n-E4B-it] passed (vision)
  • Manual test: MiniMaxAI/MiniMax-M2.5:novita — text generation works
  • Manual test: openai/gpt-oss-120b:cerebras — text generation works
  • Manual test: Qwen/Qwen2.5-72B-Instruct — text generation works
  • Verified /v1/models endpoint returns 127 models (98 text, 29 vision)
  • Verified streaming returns usage in final chunk automatically

Closes #165

@Leo-le-jeune ready for review 👀

Kamilbenkirane and others added 2 commits February 24, 2026 15:40
… router

Add HuggingFace as a text generation provider using their inference router
at router.huggingface.co, which serves 127+ models across 15 inference
providers. Follows the ChatCompletionsClient pattern (same as Groq/DeepSeek).

Closes #165

Co-Authored-By: Léo Lejeune <61250444+Leo-le-jeune@users.noreply.github.com>
@claude
Copy link

claude bot commented Feb 24, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@Kamilbenkirane Kamilbenkirane merged commit 0ed0e00 into main Feb 24, 2026
11 checks passed
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.

HuggingFace Provider: Text Generation

1 participant