--- id: text-generation version: "0.7.0" license: Apache-2.0 license_treatment: permissive maintenance: abandoned --- # text-generation — Hugging Face Text Generation Python Client License: permissive · Maintenance: abandoned · Downloads: 173.5K/mo ## What it is and what it does Text Generation is a Python client library for querying large language models hosted on Hugging Face's managed inference infrastructure. It wraps HTTP calls to text-generation-inference instances running on Hugging Face Inference Endpoints or the Hub, exposing both synchronous and asynchronous interfaces for generating text completions. The library handles request serialization via pydantic, HTTP communication through aiohttp, and model discovery via huggingface-hub. You use it by instantiating a Client (or AsyncClient) with an endpoint URL, then calling generate() or generate_stream() to send prompts and receive completions. The library supports advanced generation parameters—sampling, repetition penalties, stop sequences, grammar constraints, and token-level details—and can stream tokens as they are produced rather than waiting for the full response. Use it for: - Query a deployed Hugging Face Inference Endpoint model from Python without managing the underlying HTTP protocol. - Stream text generation tokens in real time for interactive applications or live UI updates. - Build async-first applications that query multiple models concurrently without blocking. - Prototype language model applications against Hugging Face's managed inference without running local infrastructure. - Access generation metadata (finish reason, token logprobs, top-k alternatives) for analysis or debugging. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Python client to query text generation models hosted on Hugging Face Inference Endpoints or the Hugging Face Hub, with support for both synchronous and asynchronous generation and token streaming. No—do not install. The package is abandoned (archived repository, no commits since 2026-03-21), carries four known vulnerabilities, and receives no maintenance. While the install friction is low and the license is permissive, the lack of security patches and active support makes it unsuitable for production use. Consider using the official Hugging Face Hub library or InferenceClient from huggingface-hub directly instead. ## Install pip install text-generation uv add text-generation poetry add text-generation ## Installing text-generation Before you install: Installation is straightforward with low friction—a pure Python wheel with three runtime dependencies (pydantic, aiohttp, huggingface-hub). However, the repository is archived and the package is abandoned; the last commit was 2026-03-21 and no maintenance is active, so security patches and compatibility updates are unlikely. License in practice: Licensed under Apache-2.0 (permissive), so you can use, modify, and distribute the package freely in commercial and private projects without restriction. Quickstart: pip install text-generation from text_generation import Client client = Client("https://YOUR_ENDPOINT.endpoints.huggingface.cloud") response = client.generate("Why is the sky blue?") print(response.generated_text) Requires a running text-generation-inference instance or an active Hugging Face Inference Endpoint URL to connect to. Verify before relying: - Whether the package still works reliably with current Hugging Face Inference Endpoint APIs, given the abandoned status. - Compatibility of the four known vulnerabilities (GHSA-j7x9-7j54-2v3h, GHSA-qq99-p57r-g3v7, PYSEC-2026-1965, PYSEC-2026-1966) with your use case and whether they are exploitable in your deployment context. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 173.5K/month (top 15,000 on PyPI) - Known vulnerabilities: 4 ## Tags hugging face text generation client, inference endpoint python client, llm api wrapper, text generation streaming, hugging face model inference, async text generation, language model api client, llm-client, hugging-face, async-support [View on SkillFed](https://skillfed.io/packages/text-generation) · [View on PyPI](https://pypi.org/project/text-generation/)