Skip to main content

LlamaIndex Llms Integration: iFlytek Spark

iFlytek Spark exposes an OpenAI-compatible chat-completions API, so this integration builds on OpenAILike.

Installation

pip install llama-index-llms-iflytek

Usage

Get an API password from the iFlytek open platform console and pass it as api_key (or set the IFLYTEK_API_KEY environment variable). Pick a model such as generalv3.5, 4.0Ultra or lite.

from llama_index.llms.iflytek import IFlytek

llm = IFlytek(model="4.0Ultra", api_key="your-api-password")

response = llm.complete("用一句话介绍你自己")
print(response)

Chat and streaming work the same way as any other OpenAILike model:

from llama_index.core.llms import ChatMessage

messages = [ChatMessage(role="user", content="Hello")]
for chunk in llm.stream_chat(messages):
    print(chunk.delta, end="")

The default API base is https://spark-api-open.xf-yun.com/v1; override it with the IFLYTEK_API_BASE environment variable or the api_base argument if needed.

Metadata

Release files for llama-index-llms-iflytek 0.1.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-iflytek 0.1.0
File Size Uploaded Provenance Actions
llama_index_llms_iflytek-0.1.0.tar.gz 3.3 kB With provenance Details for llama_index_llms_iflytek-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 7.2 kB

Release files / llama_index_llms_iflytek-0.1.0.tar.gz

Download URL llama_index_llms_iflytek-0.1.0.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba125c1a21d27d5daf6bba1679c8e371aec0b5f8ab107a960ee64a4914c9e66f
BLAKE2b-256 checksum
How to use checksums
a4d6105c223947af5f956ee3513c77f2c597444387bd6a2e3a6a5746f4950faf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Release files / llama_index_llms_iflytek-0.1.0-py3-none-any.whl

Download URL llama_index_llms_iflytek-0.1.0-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20a5543acd7174c4a4acd9663c9266d89ed0e7a559f3517b03110ff8c52c4d50
BLAKE2b-256 checksum
How to use checksums
9835bc0daa5f5388e5b3be4a73bdb54ae01326f31abdfc7fa4c5d7a93aa83c07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

Security for llama-index-llms-iflytek 0.1.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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llama_index_llms_iflytek-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 14, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

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