Repository navigation
Releases: provos/llm-interface
Release list
v0.2.2
OpenAI Responses API
llm_from_config(provider="openai") now talks to the Responses API, where OpenAI's reasoning models allow reasoning together with function tools (Chat Completions only accepts tools with reasoning_effort="none"). Requests are stateless; the reasoning and function-call items of a tool turn are replayed with their encrypted content on the next round, so a model keeps its chain of thought across tool calls. Structured outputs use a strict json_schema text format. Pass openai_api="chat" for the Chat Completions wrapper.
Reasoning effort and usage accounting
llm_from_config(effort=...)reaches OpenAI asreasoning_effort; reasoning tokens are reported inTokenUsage.reasoning_tokens.TokenUsage.cache_creation_tokenscounts prompt-cache writes (Anthropic bills them at the cache-write rate).- For Anthropic,
reasoning_tokensis estimated when a response carries thinking blocks: output tokens not accounted for by the visible text and tool calls.
Fixes
- Chat Completions:
parse()refuses non-strict function tools (any tool with an optional parameter); the wrapper falls back tocreate()with a strictjson_schemaresponse format. - Chat Completions: models that only accept function tools with
reasoning_effort="none"get one retry with that value, remembered per model. - Provider rate limits (HTTP 429) are retried with a growing backoff instead of failing the request.
supports_structured_outputunderstands dotted model versions such asgpt-5.6-luna.
v0.2.0
v0.1.13
This releases fixes timeouts when using Google's Gemini API.
Fixes
- convert timeouts into milliseconds as the Gemini API expects timeouts in ms (int) rather than the standard Python secs (float)
- correctly pass the timeout from llm_from_config() to the GeminiWrapper
v0.1.12
v0.1.11
v0.1.11 Release
Summary
This release adds overrides for JSON mode and structured outputs from llm_from_config
Features
- When creating a new LLM Interface with llm_from_config() the caller can now override the inferred support for JSON mode or structured outputs.
v0.1.10
v0.1.10 Release
Summary
This release adds finer JSON control in the chat interface, and switches to the new GenAI model listing API with improved test coverage.
Features
- Introduce an
allow_json_modeflag inLLMInterface.chatand_cached_chatto let callers disable automatic JSON formatting for straight chat experience - Switch
GeminiWrapper.listto usegenai client.models.list()instead of the oldclient.list_models()call; expand unit tests for model conversion, message and tool translation, and chat handling.
v0.1.9
Release Notes
Summary
This release includes improved error handling with timeout and retry logic, support for image processing in LLM interactions and token usage tracking
Features & Enhancements
- Timeout and Retry Logic: Added timeout parameters and retry mechanisms to deal with timeouts and connection failures.
- Image Handling: Integrated image support across all providers for multi-modal models.
- Token Tracking Improvements: Introduced a new TokenUsage class to track token consumption across different LLM calls.
Tests
- Unit Tests: Added unit tests for token usage tracking in the LLMInterface
- Regression Tests: Added regression tests for validating image functionality
v0.1.8
This release expands the number of model providers from Anthropic, Ollama and OpenAI to also include Gemini and OpenRouter.
Features
- OpenRouter API Support: Integrated OpenRouter API into the LLM interface supporting both structured outputs and tool calling.
- Gemini Integration: Added Gemini model support with support for structured outputs. Tool calling is not available in Gemini.
v0.1.7
Release Notes for LLM Interface v0.1.7
Overview
This minor release improves the resilience of the LLM interface and adds better model detection mechanisms.
Features
- Structured Output Capability: Improved the matching of structured output capabilities of models based on their names and versions.
- Thinking Process Integration: Introduced a
requires_thinkingattribute to theLLMInterfaceclass, allowing models like Deepseek-R1 to document their 'thinking' process which is required when using Ollama with structured outputs.
Improvements
- Error Handling: Error handling in the
LLMInterfaceclass when response caching fails. - Test Suite Reliability: Regression tests for structured output generation forces
llm_clientto use structured outputs.
v0.1.6
llm-interface 0.1.6 Release Notes
What's Changed
Testing
- MockLLMResponse now also supports basic strings in addition to Pydantic objects
Bug Fixes
- A long standing bug where the model name was not part of the cache key when temperature was not specified
Installation
pip install llm-interface==0.1.6