@blank-utils/llm 0.1.0 → 0.2.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/dist/backends/transformers.d.ts +62 -0
- package/dist/backends/transformers.d.ts.map +1 -0
- package/dist/backends/webllm.d.ts +70 -0
- package/dist/backends/webllm.d.ts.map +1 -0
- package/dist/core.d.ts +71 -0
- package/dist/core.d.ts.map +1 -0
- package/dist/detect.d.ts +21 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/helpers.d.ts +35 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/{index-mv82xhnr.js → index-yyxm9rp0.js} +4 -4
- package/dist/{index-mv82xhnr.js.map → index-yyxm9rp0.js.map} +2 -2
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -57128
- package/dist/index.js.map +3 -26
- package/dist/react/index.d.ts +310 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +7 -6
- package/dist/react/index.js.map +5 -5
- package/dist/{transformers.web-nb96jrhe.js → transformers.web-1qr6h84s.js} +19 -19
- package/dist/{transformers.web-nb96jrhe.js.map → transformers.web-1qr6h84s.js.map} +2 -2
- package/dist/types.d.ts +178 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +37 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local LLM - Browser-based LLM inference library
|
|
3
|
+
*
|
|
4
|
+
* A simple, generalized library for interacting with LLMs directly in the browser.
|
|
5
|
+
* Works in any codebase with WebGPU or WASM support.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { createLLM } from '@blank-utils/llm';
|
|
10
|
+
*
|
|
11
|
+
* const llm = await createLLM({
|
|
12
|
+
* onLoadProgress: (p) => console.log(`Loading: ${p.progress}%`)
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* // Streaming generation
|
|
16
|
+
* await llm.stream('Tell me a joke', (token) => console.log(token));
|
|
17
|
+
*
|
|
18
|
+
* // Attach to DOM elements
|
|
19
|
+
* llm.attachToInput('#input', '#output');
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @module @blank-utils/llm
|
|
23
|
+
*/
|
|
24
|
+
export { type Backend, type Device, type Quantization, type LLMConfig, type MessageRole, type ChatMessage, type StreamCallback, type LoadProgress, type LoadProgressCallback, type GenerateOptions, type LLMProviderInterface, type AttachOptions, type BrowserCapabilities, checkWebGPU, checkWasm, detectCapabilities, logCapabilities, WebLLMProvider, createWebLLMProvider, DEFAULT_WEBLLM_MODEL, WEBLLM_MODELS, TransformersProvider, createTransformersProvider, DEFAULT_TRANSFORMERS_MODEL, TRANSFORMERS_MODELS, createOutputStreamer, attachToElements, createChatUI, createLoadingIndicator, type LocalLLM, createLLM, isWebGPUSupported, } from './core';
|
|
25
|
+
export { createLLM as default } from './core';
|
|
26
|
+
export { LLMProvider, useLLM, useChat, useStream, useCompletion, LLMLoading, LLMReady, type LLMContextValue, type LLMProviderProps, type UseChatOptions, type UseChatReturn, type UseStreamOptions, type UseStreamReturn, type UseCompletionOptions, type UseCompletionReturn, type LLMLoadingProps, type LLMReadyProps, } from './react';
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAEL,KAAK,OAAO,EACZ,KAAK,MAAM,EACX,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EAGxB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,eAAe,EAGf,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,mBAAmB,EAGnB,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,sBAAsB,EAGtB,KAAK,QAAQ,EACb,SAAS,EACT,iBAAiB,GAClB,MAAM,QAAQ,CAAC;AAGhB,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAQ9C,OAAO,EAEL,WAAW,EACX,MAAM,EAGN,OAAO,EACP,SAAS,EACT,aAAa,EAGb,UAAU,EACV,QAAQ,EAGR,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,aAAa,GACnB,MAAM,SAAS,CAAC"}
|