Skip to content

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

  • BaseLLM

new HuggingFaceInferenceAPI(init): HuggingFaceInferenceAPI

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:97

HFConfig

HuggingFaceInferenceAPI

BaseLLM.constructor

model: string

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:90


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


optional maxTokens: number

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:93


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

get metadata(): LLMMetadata

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:118

LLMMetadata

BaseLLM.metadata

chat(params): Promise<AsyncIterable<ChatResponseChunk, any, any>>

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:130

LLMChatParamsStreaming

Promise<AsyncIterable<ChatResponseChunk, any, any>>

BaseLLM.chat

chat(params): Promise<ChatResponse<object>>

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:133

LLMChatParamsNonStreaming

Promise<ChatResponse<object>>

BaseLLM.chat


protected nonStreamChat(params): Promise<ChatResponse<object>>

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:162

LLMChatParamsNonStreaming

Promise<ChatResponse<object>>


protected streamChat(params): AsyncIterable<ChatResponseChunk>

Defined in: .build/typescript/packages/providers/huggingface/src/shared.ts:179

LLMChatParamsStreaming

AsyncIterable<ChatResponseChunk>