Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

siliconflow/langchain-siliconflow

Open more actions menu

Repository files navigation

langchain-siliconflow

This package contains the LangChain integration with SiliconFlow

Installation

pip install -U langchain-siliconflow

And you should configure credentials by setting the following environment variables:

export SILICONFLOW_API_KEY="your-api-key"

You can set the following environment variable to use the .cn endpoint:

export SILICONFLOW_BASE_URL="https://api.siliconflow.cn/v1"

Chat Models

ChatSiliconFlow class exposes chat models from SiliconFlow.

from langchain_siliconflow import ChatSiliconFlow

llm = ChatSiliconFlow()
llm.invoke("Sing a ballad of LangChain.")

Embeddings

SiliconFlowEmbeddings class exposes embeddings from SiliconFlow.

from langchain_siliconflow import SiliconFlowEmbeddings

embeddings = SiliconFlowEmbeddings()
embeddings.embed_query("What is the meaning of life?")

LLMs

SiliconFlowLLM class exposes LLMs from SiliconFlow.

from langchain_siliconflow import SiliconFlowLLM

llm = SiliconFlowLLM()
llm.invoke("The meaning of life is")

About

langchain partner package for siliconflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.