https://github.com/siliconflow/langchain-siliconflow
langchain partner package for siliconflow
https://github.com/siliconflow/langchain-siliconflow
Last synced: 11 months ago
JSON representation
langchain partner package for siliconflow
- Host: GitHub
- URL: https://github.com/siliconflow/langchain-siliconflow
- Owner: siliconflow
- License: mit
- Created: 2025-07-31T06:37:31.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-31T07:37:29.000Z (11 months ago)
- Last Synced: 2025-07-31T10:14:06.955Z (11 months ago)
- Language: Python
- Size: 105 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# langchain-siliconflow
This package contains the LangChain integration with SiliconFlow
## Installation
```bash
pip install -U langchain-siliconflow
```
And you should configure credentials by setting the following environment variables:
```bash
export SILICONFLOW_API_KEY="your-api-key"
```
You can set the following environment variable to use the `.cn` endpoint:
```bash
export SILICONFLOW_BASE_URL="https://api.siliconflow.cn/v1"
```
## Chat Models
`ChatSiliconFlow` class exposes chat models from SiliconFlow.
```python
from langchain_siliconflow import ChatSiliconFlow
llm = ChatSiliconFlow()
llm.invoke("Sing a ballad of LangChain.")
```
## Embeddings
`SiliconFlowEmbeddings` class exposes embeddings from SiliconFlow.
```python
from langchain_siliconflow import SiliconFlowEmbeddings
embeddings = SiliconFlowEmbeddings()
embeddings.embed_query("What is the meaning of life?")
```
## LLMs
`SiliconFlowLLM` class exposes LLMs from SiliconFlow.
```python
from langchain_siliconflow import SiliconFlowLLM
llm = SiliconFlowLLM()
llm.invoke("The meaning of life is")
```