From d900c53d91e1b356696a57bad6a2c8f333caa67a Mon Sep 17 00:00:00 2001 From: Utkarsh Rajput Date: Sat, 17 Oct 2026 23:34:01 +1100 Subject: [PATCH] chore: prepare PyPI release 0.3.0 --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/ci.yml | 3 ++- CHANGELOG.md | 4 +++- CONTRIBUTING.md | 2 +- README.md | 11 ++++------- docs/source/advanced_features.rst | 4 ++-- docs/source/conf.py | 4 +++- docs/source/discovery.rst | 4 ++-- docs/source/installation.rst | 5 +++-- docs/source/quickstart.rst | 8 +++----- llms.txt | 6 +++--- local_llm_kit/__init__.py | 2 +- local_llm_kit/models.py | 4 +++- local_llm_kit/server.py | 4 +++- pyproject.toml | 4 ++-- requirements.txt | 2 +- setup.py | 5 +---- 17 files changed, 38 insertions(+), 36 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index c319501..38c0f0c 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.2.0" + placeholder: "e.g. 0.3.0" validations: { required: true } - type: input id: python diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4d7112..9fe6c74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,8 @@ jobs: run: > python -c "import local_llm_kit; - assert local_llm_kit.__version__ == '0.2.0', local_llm_kit.__version__; + from importlib.metadata import version; + assert local_llm_kit.__version__ == version('local-llm-kit'), local_llm_kit.__version__; from local_llm_kit import LLM, chat, complete, add_function; print('smoke OK', local_llm_kit.__version__)" diff --git a/CHANGELOG.md b/CHANGELOG.md index d56938e..85c2a3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.3.0] - 2026-10-17 + ### Added - Native Apple Foundation Models adapter and apfel profile, including native schemas, fresh sessions, inline image attachments, exact token counting, cooperative timeouts and streaming stop handling. - Server discovery, native capability metadata, `doctor` CLI and a locality guard that rejects unknown or remote routes. @@ -31,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Validation scope - Core requirements remain Python 3.9+ with no new mandatory dependencies; Apple SDK and official SDK interoperability have separate version requirements. -- These are unreleased changes. Protocol/SDK tests do not establish performance superiority or certify every runtime/hardware combination. +- Protocol/SDK tests do not establish performance superiority or certify every runtime/hardware combination. ## [0.2.0] - 2026-10-17 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 09b4308..97074ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Thanks for contributing! This guide gets you from zero to a passing PR in ~10 minutes. -> **v0.2.0 context:** core install stays light (stdlib + `typing-extensions`, Python 3.9+). +> Core install stays light (stdlib + `typing-extensions`, Python 3.9+). > Heavy deps (`torch`/`transformers`/`llama-cpp-python`/`fastapi`/`uvicorn`, etc.) > are **optional extras, lazily imported** — never import them at module top-level in core paths. > Keep the legacy API working: `LLM` / `chat()` / `complete()` / `add_function()`. diff --git a/README.md b/README.md index ff48e23..7c16204 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,15 @@ 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. -**Development status:** PyPI **0.2.0** is the current release. Native Apple FM, +**Release 0.3.0** includes native Apple FM, MCP, discovery, Responses, agents, hybrid retrieval, logging and the hardware -advisor below are **unreleased changes on this branch**. To try this branch: +advisor. Install or upgrade from PyPI: ```bash -git clone https://github.com/1Utkarsh1/Local-LLM-kit.git -cd Local-LLM-kit -git checkout feat/consolidated-community-upgrades -python -m pip install -e '.[structured,server]' +python -m pip install --upgrade local-llm-kit ``` -For the released API, use the [0.2.0 documentation](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.2.0). +For the released API, use the [0.3.0 documentation](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.0). 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/advanced_features.rst b/docs/source/advanced_features.rst index f8d1740..002dfbd 100644 --- a/docs/source/advanced_features.rst +++ b/docs/source/advanced_features.rst @@ -1,7 +1,7 @@ Agents, retrieval and local history -================================== +=================================== -These features are unreleased additions. See the repository README for runnable +These features are available in 0.3.0. See the repository README for runnable examples and :doc:`community_pr_review` for their provenance and review fixes. Agents and structured output diff --git a/docs/source/conf.py b/docs/source/conf.py index 78ba7ac..58bcf95 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -6,10 +6,12 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +from local_llm_kit import __version__ + project = "Local_LLM_Kit" copyright = "2025, Utkarsh Rajput" author = "Utkarsh Rajput" -release = "0.2.0" +release = __version__ # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/source/discovery.rst b/docs/source/discovery.rst index 38e6e3b..76348cc 100644 --- a/docs/source/discovery.rst +++ b/docs/source/discovery.rst @@ -1,7 +1,7 @@ Discover servers and model capabilities -====================================== +======================================= -These APIs are unreleased additions. ``discover()`` probes known loopback +These APIs are available in 0.3.0. ``discover()`` probes known loopback endpoints concurrently without generating text. ``probe_endpoint(url)`` checks one endpoint; extra URLs can be supplied to discovery. Authentication is not handled by discovery, so an authenticated server may appear unavailable. diff --git a/docs/source/installation.rst b/docs/source/installation.rst index e35dd38..4183465 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -9,9 +9,10 @@ inference engine to be installed in the client environment. python -m venv .venv source .venv/bin/activate - pip install local-llm-kit + pip install --upgrade local-llm-kit -For unreleased features, install from the branch or checkout containing them: +Release 0.3.0 includes the discovery, MCP, agents and retrieval APIs documented +here. For development, install from a checkout: .. code-block:: bash diff --git a/docs/source/quickstart.rst b/docs/source/quickstart.rst index ae122b4..b5bffe6 100644 --- a/docs/source/quickstart.rst +++ b/docs/source/quickstart.rst @@ -4,14 +4,12 @@ Quickstart Install and run offline ----------------------- -The core package needs no GPU or model download. Unreleased features need a -source install until the next PyPI release. +The core package needs no GPU or model download. The examples here target +Local LLM Kit 0.3.0 or newer. .. code-block:: bash - pip install local-llm-kit - # From a checkout, including unreleased changes: - pip install -e . + pip install --upgrade local-llm-kit .. code-block:: python diff --git a/llms.txt b/llms.txt index 632e220..3fb936a 100644 --- a/llms.txt +++ b/llms.txt @@ -4,7 +4,7 @@ ## Status -PyPI 0.2.0 is the stable release. Discovery, Apple FM, MCP, agents, validated structured output, hybrid retrieval, logging, hardware advice and Responses are unreleased additions on feat/consolidated-community-upgrades. Do not describe them as shipped in 0.2.0. +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. ## API and fit @@ -12,7 +12,7 @@ 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. -## Unreleased additions +## 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. - HTTP adapters use `max_retries` (integer or RetryPolicy), default 2. Streaming retries only connection setup, never emitted output. @@ -31,7 +31,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.2.0 API](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.2.0) +- [Released 0.3.0 API](https://github.com/1Utkarsh1/Local-LLM-kit/tree/v0.3.0) - [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 8c78415..c8c007f 100644 --- a/local_llm_kit/__init__.py +++ b/local_llm_kit/__init__.py @@ -9,7 +9,7 @@ are optional extras, lazily imported. """ -__version__ = "0.2.0" +__version__ = "0.3.0" from .chat import achat, acomplete, chat, complete, embed from .discovery import ( diff --git a/local_llm_kit/models.py b/local_llm_kit/models.py index dba3d10..92ef2fa 100644 --- a/local_llm_kit/models.py +++ b/local_llm_kit/models.py @@ -28,6 +28,8 @@ from typing import Any, Dict, List, Optional, Tuple from urllib.parse import quote +from . import __version__ + logger = logging.getLogger(__name__) __all__ = [ @@ -308,7 +310,7 @@ def _download_url(url: str, dest_path: str, chunk_size: int = 1024 * 1024) -> st if parent: os.makedirs(parent, exist_ok=True) part = None - req = urllib.request.Request(url, headers={"User-Agent": "local-llm-kit/0.2.0"}) + req = urllib.request.Request(url, headers={"User-Agent": "local-llm-kit/" + __version__}) try: with ( urllib.request.urlopen(req, timeout=30) as resp, diff --git a/local_llm_kit/server.py b/local_llm_kit/server.py index e354685..be45dee 100644 --- a/local_llm_kit/server.py +++ b/local_llm_kit/server.py @@ -44,6 +44,8 @@ import uuid from typing import Any, Dict, List, Optional +from . import __version__ + __all__ = ["create_app", "run", "main"] @@ -722,7 +724,7 @@ def _error(message: str, status: int = 400, err_type: str = "invalid_request_err content={"error": {"message": message, "type": err_type}}, ) - app = FastAPI(title="local-llm-kit server", version="0.2.0") + app = FastAPI(title="local-llm-kit server", version=__version__) app.add_middleware( CORSMiddleware, diff --git a/pyproject.toml b/pyproject.toml index 9cba0c2..934695a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "local-llm-kit" # Single-sourced: resolved at build time from local_llm_kit/__init__.py -# (__version__ = "0.2.0"). Do NOT duplicate the version string here. +# (__version__). Do NOT duplicate the version string here. dynamic = ["version"] description = "One Python API for offline LLMs and local servers: Ollama, AirLLM, SGLang, vLLM, LM Studio and llama.cpp" readme = "README.md" @@ -143,7 +143,7 @@ where = ["."] include = ["local_llm_kit*"] namespaces = false -# Version is single-sourced from local_llm_kit/__init__.py:__version__ (= "0.2.0"). +# Version is single-sourced from local_llm_kit/__init__.py:__version__. [tool.setuptools.dynamic] version = { attr = "local_llm_kit.__version__" } diff --git a/requirements.txt b/requirements.txt index 41b88d4..1d25543 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -# local-llm-kit v0.2.0 — core runtime (light install: stdlib + typing-extensions). +# local-llm-kit — core runtime (light install: stdlib + typing-extensions). # Install with: pip install -e . typing-extensions>=4.6.0 diff --git a/setup.py b/setup.py index 0ccfed1..5fcd8ee 100644 --- a/setup.py +++ b/setup.py @@ -6,10 +6,7 @@ python setup.py --version pip install -e . # old pip / old setuptools -Version is single-sourced from ``local_llm_kit/__init__.py``:: - - __version__ = "0.2.0" - +Version is single-sourced from ``local_llm_kit/__init__.py:__version__`` via ``[tool.setuptools.dynamic]`` in ``pyproject.toml``. Do NOT add ``install_requires`` / ``extras_require`` / ``version=`` here. """