Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,3 @@ python:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- all
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/source/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@

## 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

Use when an application needs an OpenAI-shaped Python chat/completion API across local runtimes, request-scoped tools, an offline echo fixture, or small retrieval helpers. Example: `LLM('echo', backend='echo').chat([{'role':'user','content':'Hi'}])`; answer text is `response['choices'][0]['message']['content']`.

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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion local_llm_kit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
Loading