diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 38c0f0c..4d2ead9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -8,7 +8,7 @@ body: attributes: label: Package version description: Output of `pip show local-llm-kit` - placeholder: "e.g. 0.3.0" + placeholder: "e.g. 0.3.1" validations: { required: true } - type: input id: python diff --git a/.readthedocs.yml b/.readthedocs.yml index 30a2630..984698c 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -21,5 +21,3 @@ python: - requirements: docs/requirements.txt - method: pip path: . - extra_requirements: - - all \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f55922..11e42e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,11 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.1] - 2026-10-25 + ### Fixed - Transformers checks the tokenized prompt plus requested output against its context window before generation, including chat and streaming. Oversized requests raise a descriptive `ValueError` instead of reaching position-embedding failures. - Transformers streaming now propagates worker exceptions to the consumer, preserves successive text deltas and excludes the input prompt. Optional-dependency imports no longer fail while evaluating torch type annotations. - Chat, legacy completion and embedding requests no longer run synchronous inference on the FastAPI event loop. Lazy model loading also runs in a worker and is initialized once across concurrent first requests; health checks remain responsive during blocking work (issue #18). +### Changed +- Documentation builds install the core package without optional inference engines. + ## [0.3.0] - 2026-10-17 ### Added diff --git a/README.md b/README.md index 7c16204..65bda90 100644 --- a/README.md +++ b/README.md @@ -9,15 +9,17 @@ Use OpenAI-shaped chat, streaming, tools and structured output while choosing where your model runs. The core install needs only `typing-extensions`; model engines and validation packages are optional. -**Release 0.3.0** includes native Apple FM, +**Release 0.3.1** includes native Apple FM, MCP, discovery, Responses, agents, hybrid retrieval, logging and the hardware -advisor. Install or upgrade from PyPI: +advisor. This patch fixes Transformers context and streaming handling, and keeps +blocking server inference and model loading off the event loop. Install or +upgrade from PyPI: ```bash python -m pip install --upgrade local-llm-kit ``` -For the released API, use the [0.3.0 documentation](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.0). +For the released API, use the [0.3.1 documentation](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.1). No API key is needed for local inference. Prepare your engine, dependencies and model weights before disconnecting from the internet. diff --git a/docs/source/api_reference.rst b/docs/source/api_reference.rst index 2e80c17..616673a 100644 --- a/docs/source/api_reference.rst +++ b/docs/source/api_reference.rst @@ -143,7 +143,7 @@ validates generation options, forwards structured-output formats and preserves native embedding vectors. Remote tool execution defaults to disabled and requires an explicit ``execute_tools=true`` request. -The development version after 0.3.0 runs synchronous inference, embeddings and +Version 0.3.1 and newer runs synchronous inference, embeddings and lazy model loading in worker threads. Concurrent first requests construct one model, and slow inference leaves the event loop available to health checks. Streaming still uses synchronous iterators in workers. This does not add model diff --git a/docs/source/backends.rst b/docs/source/backends.rst index bcafa2a..d3cb608 100644 --- a/docs/source/backends.rst +++ b/docs/source/backends.rst @@ -273,7 +273,7 @@ models, or ``backend="llamacpp"`` with the ``llamacpp`` extra for local GGUF fil Tool calls and JSON output use the kit's prompt formatting unless the backend implements a native capability. Prompted JSON is not a schema-enforcement guarantee. -The development version after 0.3.0 checks the tokenized Transformers prompt +Transformers in 0.3.1 and newer checks the tokenized prompt plus the requested output budget against the model's reported context window. Oversized chat and completion requests raise ``ValueError`` before model generation starts, including streaming requests. Shorten the prompt or reduce diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index b5bffe6..8820651 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -5,7 +5,7 @@ Install and run offline ----------------------- The core package needs no GPU or model download. The examples here target -Local LLM Kit 0.3.0 or newer. +Local LLM Kit 0.3.1 or newer. .. code-block:: bash diff --git a/llms.txt b/llms.txt index 3fb936a..0668a3f 100644 --- a/llms.txt +++ b/llms.txt @@ -4,7 +4,7 @@ ## Status -Release 0.3.0 includes discovery, Apple FM, MCP, agents, validated structured output, hybrid retrieval, logging, hardware advice and Responses. Install or upgrade with `python -m pip install --upgrade local-llm-kit`. These additions were not shipped in 0.2.0. +Release 0.3.1 includes the discovery, Apple FM, MCP, agents, validated structured output, hybrid retrieval, logging, hardware advice and Responses APIs introduced in 0.3.0, plus the fixes below. Install or upgrade with `python -m pip install --upgrade local-llm-kit`. ## API and fit @@ -12,6 +12,11 @@ Use when an application needs an OpenAI-shaped Python chat/completion API across In-process adapters: transformers, llamacpp, experimental airllm, native apple-fm. HTTP: native ollama and OpenAI-compatible presets vllm, sglang, lmstudio, localai, llama-server, jan, gpt4all, mlx-lm, koboldcpp, transformers-serve, apfel. Generic servers use openai-compat with base_url. A preset connects to an already-running engine; it does not host or install it. Features depend on the chosen model/runtime. These are compatibility options, not a usage ranking. +## Fixes in 0.3.1 + +- In-process Transformers validates tokenized prompt plus requested output against the reported context window before generation, including streams. Oversized requests raise ValueError; input is not silently truncated. Worker errors propagate to the consumer, text deltas are preserved and prompts are excluded from streamed output. +- The HTTP server offloads synchronous chat, completion, embeddings and lazy loading to workers. Concurrent first requests construct one model. This keeps the event loop responsive; it does not guarantee backend thread safety or real-model throughput, and cancellation does not terminate an active worker. + ## Additions in 0.3.0 - `discover`, `probe_endpoint`, `find_local_server` and CLI `doctor`: read native capability metadata when available. Unknown locality stays unknown. `LLM(..., require_local=True)` refuses unverified/remote execution and checks again before chat/completion. It trusts metadata and is not a network sandbox. @@ -31,7 +36,7 @@ Core stays light. Native inference dependencies are optional and prepared weight ## References - [Repository and quickstart](https://github.com/1Utkarsh1/Local-LLM-kit) -- [Released 0.3.0 API](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.0) +- [Released 0.3.1 API](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.1) - [Backend compatibility](https://github.com/1Utkarsh1/Local-LLM-kit/blob/main/docs/source/backends.rst) - [API reference](https://github.com/1Utkarsh1/Local-LLM-kit/blob/main/docs/source/api_reference.rst) - [Examples](https://github.com/1Utkarsh1/Local-LLM-kit/tree/main/examples) diff --git a/local_llm_kit/__init__.py b/local_llm_kit/__init__.py index c8c007f..ea4af67 100644 --- a/local_llm_kit/__init__.py +++ b/local_llm_kit/__init__.py @@ -9,7 +9,7 @@ are optional extras, lazily imported. """ -__version__ = "0.3.0" +__version__ = "0.3.1" from .chat import achat, acomplete, chat, complete, embed from .discovery import (