@hilbras/sdk weekly downloads statistics
Provider-agnostic LLM client SDK — streaming, tool calling, embeddings, image generation, speech synthesis, transcription, reranking, circuit breaker, retry, reasoning normalization, cost enforcement, structured output with schema validation, type-safe to
@hilbras/sdk has 1,322 recorded weekly downloads on npm, an increase of 721% over the past 30 days, ranking #1998 of 3,247 tracked listings.
About @hilbras/sdk
Why @hilbras/sdk?
Most LLM SDKs just wrap one provider's API. @hilbras/sdk is an AI
Execution Engine that optimizes, controls, validates, and observes every
request, even when you use only one provider.
Application
│
▼
┌───────────────────────────────────────────────┐
│ @hilbras/sdk │
│ │
│ Model Router Execution Policies │
│ Structured Output Observability Hooks │
│ Provider Abstraction SSRF-safe Registration │
│ Streaming & Tools Reasoning Normalizer │
│ Circuit Breaker Retry & Backoff │
│ Token Counting Cost Enforcement │
│ Prompt Caching Auto-Repair Output │
│ Middleware Pipeline Typed Errors │
│ Plugin System RBAC Access Control │
│ SLA Monitoring A/B Prompt Testing │
│ Cost Alerts Audit Logging │
└──────────────────────┬────────────────────────┘
│
┌────────────┼────────────┐
▼ ▼ ▼
OpenAI Anthropic Gemini
│ │ │
Groq Ollama Azure
Zero runtime dependencies. Runs everywhere: Node 18+, Bun, Deno, browsers, VS Code extensions, CLIs, edge runtimes.
Install
npm install @hilbras/sdk
React (optional)
npm install @hilbras/sdk
Quick start
npm install @hilbras/sdk
import { HilbrasClient } from "@hilbras/sdk";
const client = new HilbrasClient();
// One-line setup using built-in catalog (OpenAI, Anthropic, Gemini, Groq, etc.)
client.addProviderFromCatalog("openai", "gpt-4o", process.env.OPENAI_API_KEY!);
// Streaming
for await (const chunk of client.stream({
provider: "OpenAI",
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
})) {
if (chunk.type === "text") process.stdout.write(chunk.text);
}
// Non-streaming
const reply = await client.complete({
provider: "OpenAI",
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
Configuration
Per-client tokenizer
By default, token counting uses a heuristic word-based estimator. Pass a custom tokenizer to scope it to a single client instance:
import { HilbrasClient } from "@hilbras/sdk";
// Your BPE / tiktoken / ollama tokenizer
const tokenizer = {
count(text: string): number {
return yourTokenizer.encode(text).length;
},
};
const client = new HilbrasClient({ tokenizer });
// Every request on this client uses your tokenizer
const reply = await client.complete({
provider: "openai",
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
v2.5.0+: The global
setTokenizer()/getTokenizer()singletons are deprecated. Use the per-clienttokenizerconfig instead to avoid cross-client interference.
Middleware
Wrap the transport with middleware for auth, logging, or custom transforms. Middleware runs on every request (including retries) for the client:
import { HilbrasClient } from "@hilbras/sdk";
import { authMiddleware, loggingMiddleware, composeMiddlewares } from "@hilbras/sdk";
const client = new HilbrasClient({
middleware: composeMiddlewares(
authMiddleware(() => process.env.API_KEY!),
loggingMiddleware(console),
),
});
// All requests go through both middleware layers
const reply = await client.complete({
provider: "openai",
model: "gpt-4o",
messages: [{ role: "user", content: "Hello!" }],
});
You can also use MiddlewareTransport directly to wrap any transport:
import { MiddlewareTransport, FetchTransport } from "@hilbras/sdk";
const transport = new MiddlewareTransport(
new FetchTransport(),
composeMiddlewares(authMiddleware(() => "my-key")),
);
Configuration
v3.3 adds a typed configuration resolver with explicit precedence and secret-safe diagnostics:
import { HilbrasClient, createRuntimeSource } from "@hilbras/sdk";
const client = new HilbrasClient({
configSources: [
createRuntimeSource({ temperature: 0.3, maxRetries: 2 }),
],
});
console.log(client.getConfigDiagnostics());
See Configuration and the v3.2 migration guide.
Features at a glance…
Description from the npm listing.
- llm
- ai-sdk
- provider-agnostic
- openai
- anthropic
- claude
- gemini
- azure-openai
- groq
- ollama
- streaming
- tool-calling
- function-calling
- circuit-breaker
- retry
- cost-tracking
- budget-enforcement
- observability
- structured-output
- typescript
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (592)Similar npm AI SDKs plugins
All 20 @hilbras/sdk alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@hilbras/sdk. First seen Oct 16, 2026; last successful collection Oct 28, 2026. See the methodology.