@reviewpipe/provider-huggingface
v0.1.0
Published
Hugging Face Inference API provider for reviewpipe (Tier 1) — sentiment, embeddings, and summarization over fetch.
Downloads
125
Maintainers
Readme
@reviewpipe/provider-huggingface
Sentiment, embeddings, and summarization via the
Hugging Face Inference API (Tier
1 — hosted, bring your own token). A thin fetch wrapper — no SDK dependency.
import { Pipeline } from '@reviewpipe/core';
import { HuggingFaceProvider } from '@reviewpipe/provider-huggingface';
const result = await new Pipeline()
.source(adapter)
.provider(new HuggingFaceProvider({ apiKey: process.env.HF_TOKEN! }))
.run(input);capabilities: { sentiment: true, embeddings: true, summarization: true, customPrompts: false }.
apiKeyis required — the constructor throws without one.- Retries
429(rate limit) and503(model loading) with exponential backoff (maxRetries,initialBackoffMs), and can pace requests withbatchSize/batchDelayMs. - Empty text is scored as a no-signal neutral without a network call.
- Models are configurable (
sentimentModel,embeddingModel,summarizationModel);fetchandsleepare injectable for testing.
