@xberg-io/liter-llm 1.11.2 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -307,7 +307,7 @@ To use the MCP server inside a coding agent, install the **liter-llm plugin** fr
307
307
 
308
308
  ## Part of Xberg.io
309
309
 
310
- - [Xberg](https://github.com/xberg-io/xberg) — document intelligence: text, tables, metadata from 91+ formats with optional OCR.
310
+ - [Xberg](https://github.com/xberg-io/xberg) — document intelligence: text, tables, metadata from 101 formats with optional OCR.
311
311
  - [Xberg Enterprise](https://github.com/xberg-io/xberg-enterprise) — managed extraction API with SDKs, dashboards, and observability.
312
312
  - [crawlberg](https://github.com/xberg-io/crawlberg) — web crawling and scraping with HTML→Markdown and headless-Chrome fallback.
313
313
  - [html-to-markdown](https://github.com/xberg-io/html-to-markdown) — fast, lossless HTML→Markdown engine.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef — DO NOT EDIT.
2
- // alef:hash:645d8ff0f3a0ef7684f9b9ea4ce1ae251a78a2a3481ecdeabf7643c53d644bb0
2
+ // alef:hash:938b8ffd93c3e30d74875f875188c728addee9d4b80a97a7ac22716b3154c7c5
3
3
  // To regenerate: alef generate
4
4
  // To verify freshness: alef verify --exit-code
5
5
  /* eslint-disable */
@@ -373,6 +373,27 @@ export declare enum BatchStatus {
373
373
  Cancelled = "cancelled",
374
374
  }
375
375
 
376
+ /**
377
+ * AWS Bedrock configuration.
378
+ *
379
+ * All fields are optional; anything left unset falls back to the standard
380
+ * AWS environment variables (`AWS_DEFAULT_REGION` / `AWS_REGION`,
381
+ * `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`,
382
+ * `BEDROCK_CROSS_REGION`).
383
+ */
384
+ export interface BedrockConfig {
385
+ /** AWS region (e.g. `"us-east-1"`). */
386
+ readonly region?: string
387
+ /** Cross-region inference profile prefix (e.g. `"us"`). */
388
+ readonly crossRegionPrefix?: string
389
+ /** Explicit AWS access key ID. */
390
+ readonly accessKeyId?: string
391
+ /** Explicit AWS secret access key. */
392
+ readonly secretAccessKey?: string
393
+ /** Explicit AWS session token (temporary credentials). */
394
+ readonly sessionToken?: string
395
+ }
396
+
376
397
  /** Configuration for budget enforcement. */
377
398
  export interface BudgetConfig {
378
399
  /** Maximum total spend across all models, in USD. `None` means unlimited. */
@@ -500,7 +521,7 @@ export interface ChatCompletionRequest {
500
521
  readonly streamOptions?: StreamOptions
501
522
  /** Random seed for reproducible outputs. Provider support varies. */
502
523
  readonly seed?: number
503
- /** Reasoning effort level (low, medium, high) for extended-thinking models. */
524
+ /** Reasoning effort level (minimal, low, medium, high, max) for extended-thinking models. */
504
525
  readonly reasoningEffort?: ReasoningEffort
505
526
  /**
506
527
  * Output modalities to request from the model.
@@ -653,6 +674,12 @@ export interface CreateResponseRequest {
653
674
  readonly maxOutputTokens?: number
654
675
  /** Optional metadata. */
655
676
  readonly metadata?: JsonValue
677
+ /**
678
+ * Whether to stream the response.
679
+ *
680
+ * Managed by the client layer — do not set directly.
681
+ */
682
+ readonly stream?: boolean
656
683
  }
657
684
 
658
685
  /** Request to generate speech audio from text. */
@@ -1048,6 +1075,108 @@ export interface JsonSchemaFormat {
1048
1075
  readonly strict?: boolean
1049
1076
  }
1050
1077
 
1078
+ /** Budget enforcement configuration. */
1079
+ export interface LlmBudgetConfig {
1080
+ /** Global spend limit in USD. */
1081
+ readonly globalLimit?: number
1082
+ /** Per-model spend limits in USD, keyed by model name. */
1083
+ readonly modelLimits?: Record<string, number>
1084
+ /** Enforcement mode: `"hard"` (reject over-budget requests) or `"soft"` (log only). */
1085
+ readonly enforcement?: string
1086
+ }
1087
+
1088
+ /** Response cache configuration. */
1089
+ export interface LlmCacheConfig {
1090
+ /** Maximum number of cached entries. */
1091
+ readonly maxEntries?: number
1092
+ /** Cache entry time-to-live, in seconds. */
1093
+ readonly ttlSeconds?: number
1094
+ /** Cache backend name (e.g. `"memory"`, or an `opendal` scheme). */
1095
+ readonly backend?: string
1096
+ /** Backend-specific configuration key/value pairs. */
1097
+ readonly backendConfig?: Record<string, string>
1098
+ }
1099
+
1100
+ /**
1101
+ * Canonical configuration for an LLM client.
1102
+ *
1103
+ * All fields except `model` are optional so that partially-specified
1104
+ * configs (e.g. from environment-driven defaults) round-trip cleanly.
1105
+ * Convert to a runtime client configuration via
1106
+ * [`LlmConfig::into_client_builder`].
1107
+ *
1108
+ * `temperature` and `max_tokens` are request-time parameters rather than
1109
+ * client-level settings; they are carried on this struct for callers to
1110
+ * read when building individual requests, and are intentionally **not**
1111
+ * mapped by [`LlmConfig::into_client_builder`].
1112
+ */
1113
+ export interface LlmConfig {
1114
+ /** Model identifier (e.g. `"gpt-4o"`, `"bedrock/anthropic.claude-3-sonnet-20240229-v1:0"`). */
1115
+ readonly model?: string
1116
+ /** API key for authentication. */
1117
+ readonly apiKey?: string
1118
+ /**
1119
+ * Override base URL. When set, all requests go here and provider
1120
+ * auto-detection is skipped.
1121
+ */
1122
+ readonly baseUrl?: string
1123
+ /** Request timeout, in seconds. */
1124
+ readonly timeoutSecs?: number
1125
+ /** Maximum number of retries on 429 / 5xx responses. */
1126
+ readonly maxRetries?: number
1127
+ /** Sampling temperature for requests built from this config. */
1128
+ readonly temperature?: number
1129
+ /** Maximum number of tokens to generate for requests built from this config. */
1130
+ readonly maxTokens?: number
1131
+ /**
1132
+ * Automatically load the API key from the provider's environment variable
1133
+ * when no explicit key is provided (default: `true`).
1134
+ */
1135
+ readonly loadEnv?: boolean
1136
+ /** Extra headers sent on every request. */
1137
+ readonly headers?: Record<string, string>
1138
+ /** Custom provider configurations, in addition to the built-in providers. */
1139
+ readonly providers?: Array<LlmProviderConfig>
1140
+ /** Response cache configuration. */
1141
+ readonly cache?: LlmCacheConfig
1142
+ /** Budget enforcement configuration. */
1143
+ readonly budget?: LlmBudgetConfig
1144
+ /** Per-model rate limiting configuration. */
1145
+ readonly rateLimit?: LlmRateLimitConfig
1146
+ /** Enable per-request cost tracking. */
1147
+ readonly costTracking?: boolean
1148
+ /** Enable OpenTelemetry-compatible tracing spans. */
1149
+ readonly tracing?: boolean
1150
+ /** Cooldown duration after transient errors, in seconds. */
1151
+ readonly cooldownSecs?: number
1152
+ /** Background health check interval, in seconds. */
1153
+ readonly healthCheckSecs?: number
1154
+ /** AWS Bedrock configuration (region, credentials, cross-region routing). */
1155
+ readonly bedrock?: BedrockConfig
1156
+ }
1157
+
1158
+ /** A custom provider configuration entry. */
1159
+ export interface LlmProviderConfig {
1160
+ /** Provider name, used to key model prefix matching. */
1161
+ readonly name?: string
1162
+ /** Base URL for the provider's OpenAI-compatible API. */
1163
+ readonly baseUrl?: string
1164
+ /** Header name used to carry the API key (defaults to `Authorization` when unset). */
1165
+ readonly authHeader?: string
1166
+ /** Model name prefixes routed to this provider (e.g. `["my-provider/"]`). */
1167
+ readonly modelPrefixes?: Array<string>
1168
+ }
1169
+
1170
+ /** Per-model rate limiting configuration. */
1171
+ export interface LlmRateLimitConfig {
1172
+ /** Requests per minute limit. */
1173
+ readonly rpm?: number
1174
+ /** Tokens per minute limit. */
1175
+ readonly tpm?: number
1176
+ /** Rate limit window, in seconds. */
1177
+ readonly windowSeconds?: number
1178
+ }
1179
+
1051
1180
  /** A chat message in a conversation. */
1052
1181
  export type Message =
1053
1182
  | { role: 'system'; 0: SystemMessage }
@@ -1430,6 +1559,8 @@ export declare enum ReasoningEffort {
1430
1559
  Low = "low",
1431
1560
  Medium = "medium",
1432
1561
  High = "high",
1562
+ Minimal = "minimal",
1563
+ Max = "max",
1433
1564
  }
1434
1565
 
1435
1566
  /** Result of a [`refresh_catalog`] call. */
@@ -1744,8 +1875,15 @@ export declare enum ToolChoiceMode {
1744
1875
 
1745
1876
  /** Tool execution result returned to the model. */
1746
1877
  export interface ToolMessage {
1747
- /** Result of the tool execution. */
1748
- readonly content?: string
1878
+ /**
1879
+ * Result of the tool execution as plain text or an array of content parts
1880
+ * (text, images, documents, audio), mirroring [`UserMessage::content`].
1881
+ *
1882
+ * `#[serde(untagged)]` on [`UserContent`] means a bare JSON string still
1883
+ * deserialises into `Text`, so tool results persisted before this field
1884
+ * carried structured content continue to round-trip.
1885
+ */
1886
+ readonly content?: UserContent
1749
1887
  /** ID of the tool call this result responds to. */
1750
1888
  readonly toolCallId?: string
1751
1889
  /** Optional tool/function name. */
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xberg-io/liter-llm",
3
- "version": "1.11.2",
3
+ "version": "1.16.0",
4
4
  "description": "Universal LLM API client with Rust-powered polyglot bindings.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -18,12 +18,12 @@
18
18
  },
19
19
  "files": ["index.js", "index.d.ts", "*.node"],
20
20
  "optionalDependencies": {
21
- "@xberg-io/liter-llm-linux-x64-gnu": "1.11.2",
22
- "@xberg-io/liter-llm-linux-arm64-gnu": "1.11.2",
23
- "@xberg-io/liter-llm-darwin-x64": "1.11.2",
24
- "@xberg-io/liter-llm-darwin-arm64": "1.11.2",
25
- "@xberg-io/liter-llm-win32-x64-msvc": "1.11.2",
26
- "@xberg-io/liter-llm-win32-arm64-msvc": "1.11.2"
21
+ "@xberg-io/liter-llm-linux-x64-gnu": "1.16.0",
22
+ "@xberg-io/liter-llm-linux-arm64-gnu": "1.16.0",
23
+ "@xberg-io/liter-llm-darwin-x64": "1.16.0",
24
+ "@xberg-io/liter-llm-darwin-arm64": "1.16.0",
25
+ "@xberg-io/liter-llm-win32-x64-msvc": "1.16.0",
26
+ "@xberg-io/liter-llm-win32-arm64-msvc": "1.16.0"
27
27
  },
28
28
  "napi": {
29
29
  "packageName": "@xberg-io/liter-llm",