Skip to main content

LlamaIndex LLM Integration: Stepfun

Installation

To install the required packages, run:

%pip install llama-index-llms-stepfun
!pip install llama-index

Setup

Initialize StepFun LLM

First, import the necessary libraries and set up your StepFun instance. Replace step-1v-8k, and TOKEN with your model name, and API key, respectively:

import os
from typing import List, Optional
from llama_index.llms.stepfun import StepFun
from llama_index.core.llms import ChatMessage

llm = StepFun(
    api_key="TOKEN",
    max_tokens=256,
    context_window=4096,
    model="step-1v-8k",
)

Chat Functionality

StepFun supports chat APIs, allowing you to handle conversation-like interactions. Here’s how to use it:

from llama_index.llms.stepfun import StepFun
from llama_index.core.llms import ChatMessage

llm = StepFun(
    api_key="",
    max_tokens=256,
    context_window=4096,
    model="step-1v-8k",
)


message = ChatMessage(role="user", content="Tell me a joke")
resp = llm.chat([message])
print(resp)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_index_llms_stepfun-1.3.0.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_index_llms_stepfun-1.3.0-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file llama_index_llms_stepfun-1.3.0.tar.gz.

File metadata

  • Download URL: llama_index_llms_stepfun-1.3.0.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_stepfun-1.3.0.tar.gz
Algorithm Hash digest
SHA256 7c1a98a69678fad9ee3cbd5dd116b0dd6745d5989121ec9b1fc4c6f08f9510b5
MD5 ddc819a2fe632d5c1995ffa7614b4804
BLAKE2b-256 85052f55e6d855fba54582dc921214da9e1d125be1b71bcd22f1a1d487d0db0c

See more details on using hashes here.

File details

Details for the file llama_index_llms_stepfun-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: llama_index_llms_stepfun-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for llama_index_llms_stepfun-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 60a97695521da0da687618c136d4620ba34fabe0f3cb859e8ed215632bc650c4
MD5 aa846ac641b45381d277eb785c7203af
BLAKE2b-256 0bd46b6a7f0838654be50d94e2a889c2458de748283b181611e210865b7c8a2c

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.1

2 files

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.1

2 files

1.0.0

2 files

0.3.2

2 files

0.3.1

2 files

0.1.0

2 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