Skip to main content

LlamaIndex Llms Integration: ModelScope

Installation

To install the required package, run:

!pip install llama-index-llms-modelscope

Basic Usage

Initialize the ModelScopeLLM

To use the ModelScopeLLM model, create an instance by specifying the model name and revision:

import sys
from llama_index.llms.modelscope import ModelScopeLLM

llm = ModelScopeLLM(model_name="qwen/Qwen3-8B", model_revision="master")

Generate Completions

To generate a text completion for a prompt, use the complete method:

rsp = llm.complete("Hello, who are you?")
print(rsp)

Using Message Requests

You can chat with the model by using a list of messages. Here’s how to set it up:

from llama_index.core.base.llms.types import MessageRole, ChatMessage

messages = [
    ChatMessage(
        role=MessageRole.SYSTEM, content="You are a helpful assistant."
    ),
    ChatMessage(role=MessageRole.USER, content="How to make cake?"),
]
resp = llm.chat(messages)
print(resp)

LLM Implementation example

https://docs.llamaindex.ai/en/stable/examples/llm/modelscope/

Metadata

Release files for llama-index-llms-modelscope 0.8.0

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

Source distribution (sdist)

Source distribution for llama-index-llms-modelscope 0.8.0
File Size Uploaded Provenance Actions
llama_index_llms_modelscope-0.8.0.tar.gz 5.4 kB Without provenance Details for llama_index_llms_modelscope-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llama-index-llms-modelscope 0.8.0
File Interpreter ABI Platform Actions
llama_index_llms_modelscope-0.8.0-py3-none-any.whl Python 3 none any Details for llama_index_llms_modelscope-0.8.0-py3-none-any.whl

Total release size: 10.5 kB

Release files / llama_index_llms_modelscope-0.8.0.tar.gz

Download URL llama_index_llms_modelscope-0.8.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c96ff01d5c1c70131d0c4fa2b616d410cc33a8b116014a429c84819bac5b9687
BLAKE2b-256 checksum
How to use checksums
f3cf0341c8fdc2c6bcf2541e67b0cfd3ba6464335321d310a1e629ee85a69499
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / llama_index_llms_modelscope-0.8.0-py3-none-any.whl

Download URL llama_index_llms_modelscope-0.8.0-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
53f4ba6c97981792139eb61d38975d61cc642b88066e6525c262dd9f0debb883
BLAKE2b-256 checksum
How to use checksums
a20d359db444af8cbff104a4ef18a12f337a1ad747d230a9967dc2a2b9dc944d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for llama-index-llms-modelscope 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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