Skip to main content

langchain-modelscope-integration

This package contains the LangChain integration with ModelScope

Installation

pip install -U langchain-modelscope-integration

Head to ModelScope to sign up to ModelScope and generate an SDK token. Once you've done this set the MODELSCOPE_SDK_TOKEN environment variable:

export MODELSCOPE_SDK_TOKEN=<your_sdk_token>

Chat Models

ModelScopeChatEndpoint class exposes chat models from ModelScope. See available models here.

from langchain_modelscope import ModelScopeChatEndpoint

llm = ModelScopeChatEndpoint(model="Qwen/Qwen2.5-Coder-32B-Instruct")
llm.invoke("Sing a ballad of LangChain.")

Embeddings

ModelScopeEmbeddings class exposes embeddings from ModelScope.

from langchain_modelscope import ModelScopeEmbeddings

embeddings = ModelScopeEmbeddings(model_id="damo/nlp_corom_sentence-embedding_english-base")
embeddings.embed_query("What is the meaning of life?")

Metadata

Release files for langchain-modelscope-integration 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-modelscope-integration 0.1.1
File Size Uploaded
langchain_modelscope_integration-0.1.1.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-modelscope-integration 0.1.1
File Interpreter ABI Platform
langchain_modelscope_integration-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / langchain_modelscope_integration-0.1.1.tar.gz

Download URL langchain_modelscope_integration-0.1.1.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
85137eec300194766653f1efadff3d17630e972c7a81f21872211f6d5b79642b
BLAKE2b-256 checksum
How to use checksums
af4e391721915011ce6e1cd3b584f558dd2c262cba90d9390f72c157fb3b16ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release files / langchain_modelscope_integration-0.1.1-py3-none-any.whl

Download URL langchain_modelscope_integration-0.1.1-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e6b4985ec2ac340869c3d2d2d5c7413d91d22f0f3c62a5a26efd20aa4b9ba13d
BLAKE2b-256 checksum
How to use checksums
67670759266bcf37055bf1e65a8a495968064163e0a51239f0a28416838fad47
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page