$npx skillfedfor your agent

transformers-stream-generator

This is a text generation method which returns a generator, streaming out each token in real-time during inference, based on Huggingface/Transformers.

With conditionsPyPI Artificial IntelligenceReleased Mar 2024345.9K downloads / moMIT LicenseSource build

Decision gist · record as of 2026-08-14

sdist only — transformers-stream-generator-0.0.5.tar.gz · builds from source
v0.0.5 · released 2024-03-11 · Python >=3.5

Yes, with conditions. Install if you need token-by-token streaming for a Transformers model and your Transformers version is close to 2024-03-11 or earlier. Do not install if you are using a recent Transformers version, as the dormant status and monkey-patching approach mean compatibility is not guaranteed. Test thoroughly in your environment before production use.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires an existing Transformers installation and a compatible model; the package monkey-patches Transformers internals, so compatibility with your installed Transformers version is not guaranteed given the project's dormant status.
  • High install friction: no runtime dependencies listed, but the package modifies Transformers internals via monkey-patching (init_stream_support).
  • Last commit was 2024-03-11 and the project is dormant, meaning it may not track breaking changes in newer Transformers versions.

License · maintenance · safety

MIT License (permissive) — MIT License is permissive and imposes no restrictions on use or redistribution, though you should verify compatibility with your Transformers version's license.

last release 2024-03-11 (886 days) · last repo commit 2024-03-11 · 95 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 345,880 downloads/mo, #7,360 on PyPI

Verify before relying

pip install transformers-stream-generator

from transformers_stream_generator import init_stream_support
init_stream_support()

generator = model.generate(input_ids, do_stream=True, do_sample=True)
for token in generator:
    word = tokenizer.decode(token)
    print(word)
  • Compatibility with Transformers versions released after 2024-03-11 (the last commit date).
  • Whether the monkey-patching approach in init_stream_support() breaks or conflicts with recent Transformers API changes.
  • Performance overhead or memory implications of streaming vs. standard generation.
Same gist for agents: .md · .json

What it is and what it does

This package wraps Hugging Face Transformers to enable token-by-token streaming during text generation. Instead of waiting for model.generate() to complete and return all tokens at once, you call init_stream_support() once, then pass do_stream=True to generate(), and receive a generator that yields each token as it is produced. This is useful for real-time applications like chatbots or live transcription where you want to display output incrementally rather than after the full inference completes.

The package works by modifying Transformers internals through monkey-patching. It has no explicit runtime dependencies and supports Python 3.5 and later. However, it is dormant (last updated 2024-03-11) and may not work with newer Transformers versions that have changed their generation API or internal structure.

Use it for

  • Build a chatbot or conversational interface that displays model responses token-by-token as they are generated.
  • Stream long-form text generation (summaries, articles) to a web client in real-time without waiting for completion.
  • Implement live transcription or translation where partial results appear as soon as each token is ready.
  • Create interactive demos where users see model output appearing incrementally, improving perceived responsiveness.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, with conditions.

Install if you need token-by-token streaming for a Transformers model and your Transformers version is close to 2024-03-11 or earlier. Do not install if you are using a recent Transformers version, as the dormant status and monkey-patching approach mean compatibility is not guaranteed. Test thoroughly in your environment before production use.

Install

transformers-stream-generator on PyPI

Before you install

High install friction: no runtime dependencies listed, but the package modifies Transformers internals via monkey-patching (init_stream_support). Last commit was 2024-03-11 and the project is dormant, meaning it may not track breaking changes in newer Transformers versions.

Requires an existing Transformers installation and a compatible model; the package monkey-patches Transformers internals, so compatibility with your installed Transformers version is not guaranteed given the project's dormant status.

License in practice

MIT License is permissive and imposes no restrictions on use or redistribution, though you should verify compatibility with your Transformers version's license.

Quickstart

pip install transformers-stream-generator

from transformers_stream_generator import init_stream_support
init_stream_support()

generator = model.generate(input_ids, do_stream=True, do_sample=True)
for token in generator:
    word = tokenizer.decode(token)
    print(word)

Verify before relying

  • Compatibility with Transformers versions released after 2024-03-11 (the last commit date).
  • Whether the monkey-patching approach in init_stream_support() breaks or conflicts with recent Transformers API changes.
  • Performance overhead or memory implications of streaming vs. standard generation.

Package facts

LicenseMIT License permissive
Python supportSupports the current Python release >=3.5
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceDormant 886 days since the last release
Last repo commit
First released
Downloads345,880 / month, #7,360 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Scientific/Engineering :: Artificial Intelligence

Evidence: transformers-stream-generator-0.0.5.tar.gz

Tags

Capabilities
streaming text generationtoken streaming transformersreal-time language model outputgenerator-based inferencehuggingface streamingincremental token output
Topics
streaming-inferencemonkey-patching
PyPI keywords
GPTstreamtransformersNLPmodel hubtransformertext generationsummarizationtranslationq&aqgmachine learningCausalLM

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “streaming text generation”

Give your agent the search over MCP, or paste the wish link into any chat.

More Artificial Intelligence packages

litellm With conditions
PyPI · Artificial Intelligence · released Aug 2026

LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.

Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.

MITcompiled wheel
682.8Mdownloads / mo
huggingface-hub Worth it
PyPI · Artificial Intelligence · released Aug 2026

Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.

Install it if you work with Hugging Face Hub models or datasets.

Apache-2.0pure Python · 3.10.0+
442.4Mdownloads / mo
langchain Worth it
PyPI · Python Modules · released Aug 2026

LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.

MITpure Python
315.4Mdownloads / mo
hf-xet With conditions
PyPI · Artificial Intelligence · released Aug 2026

hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.

Apache-2.0compiled wheel · 3.8+
258.4Mdownloads / mo
tokenizers Worth it
PyPI · Artificial Intelligence · released Apr 2026

Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.

Apache-2.0compiled wheel · 3.10+
222.9Mdownloads / mo
transformers Worth it
PyPI · Artificial Intelligence · released Aug 2026

Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.

Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.

permissive licensepure Python · 3.10.0+
186.6Mdownloads / mo

See also stop-sequencer · spacy-transformers · qwen-tts · text-generation · optimum-onnx · langchain-huggingface · optimum · opentelemetry-instrumentation-transformers · f5-tts