HuggingFaceInferenceAPI
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:89
Wrapper on the Hugging Face’s Inference API. API Docs: https://huggingface.co/docs/huggingface.js/inference/README List of tasks with models: huggingface.co/api/tasks
Note that Conversational API is not yet supported by the Inference API. They recommend using the text generation API instead. See: https://github.com/huggingface/huggingface.js/issues/586#issuecomment-2024059308
Extends
Section titled “Extends”BaseLLM
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new HuggingFaceInferenceAPI(
init
):HuggingFaceInferenceAPI
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:97
Parameters
Section titled “Parameters”Returns
Section titled “Returns”HuggingFaceInferenceAPI
Overrides
Section titled “Overrides”BaseLLM.constructor
Properties
Section titled “Properties”model:
string
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:90
temperature
Section titled “temperature”temperature:
number
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:91
topP:
number
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:92
maxTokens?
Section titled “maxTokens?”
optional
maxTokens:number
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:93
contextWindow
Section titled “contextWindow”contextWindow:
number
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:94
hf:
HfInference
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:95
Accessors
Section titled “Accessors”metadata
Section titled “metadata”Get Signature
Section titled “Get Signature”get metadata():
LLMMetadata
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:118
Returns
Section titled “Returns”LLMMetadata
Overrides
Section titled “Overrides”BaseLLM.metadata
Methods
Section titled “Methods”chat()
Section titled “chat()”Call Signature
Section titled “Call Signature”chat(
params
):Promise
<AsyncIterable
<ChatResponseChunk
,any
,any
>>
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:130
Parameters
Section titled “Parameters”params
Section titled “params”LLMChatParamsStreaming
Returns
Section titled “Returns”Promise
<AsyncIterable
<ChatResponseChunk
, any
, any
>>
Overrides
Section titled “Overrides”BaseLLM.chat
Call Signature
Section titled “Call Signature”chat(
params
):Promise
<ChatResponse
<object
>>
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:133
Parameters
Section titled “Parameters”params
Section titled “params”LLMChatParamsNonStreaming
Returns
Section titled “Returns”Promise
<ChatResponse
<object
>>
Overrides
Section titled “Overrides”BaseLLM.chat
nonStreamChat()
Section titled “nonStreamChat()”
protected
nonStreamChat(params
):Promise
<ChatResponse
<object
>>
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:162
Parameters
Section titled “Parameters”params
Section titled “params”LLMChatParamsNonStreaming
Returns
Section titled “Returns”Promise
<ChatResponse
<object
>>
streamChat()
Section titled “streamChat()”
protected
streamChat(params
):AsyncIterable
<ChatResponseChunk
>
Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:179
Parameters
Section titled “Parameters”params
Section titled “params”LLMChatParamsStreaming
Returns
Section titled “Returns”AsyncIterable
<ChatResponseChunk
>