Skip to content

Releases

v0.4.1

Choose a tag to compare

@codelion codelion released this 02 Nov 05:00
f74e678

What's Changed

Action required if you use these features

  • executecode is now disabled by default (#337, #302). The plugin runs Python from requests and LLM responses with no sandboxing. To keep using it, start optillm with --enable-unsafe-plugins=executecode or set OPTILLM_ENABLE_UNSAFE_PLUGINS=executecode. Only enable it in single-user, air-gapped environments.
  • MCP secrets could be written to logs. The MCP plugin wrote configured env and headers values, which can include API keys, to ~/.optillm/logs/mcp_plugin.log. It now logs only the names. If you use the plugin, check that file for old secrets and rotate any you find.

New

  • Streaming hints plugin (#352, #206): streaming_hints watches the model's reasoning as it is generated and injects relevant hints from a memory bank at moments of uncertainty.
  • Legacy completions endpoint: the inbuilt inference server now exposes POST /v1/completions.
  • LLM gateway guide: docs/llm-gateway.md covers using the proxy plugin for routing and inference optimization together.

Security

  • readurls: blocks SSRF destinations, including CGNAT/shared and multicast ranges.
  • z3: statically gates solver code to the declared z3/sympy subset and closes string-based evasions of the AST attribute denylist.

Fixes

  • max_completion_tokens (#350): pass-through and proxy requests no longer add max_tokens, which o-series and gpt-5 models reject with a 400. The local inference server now honors max_completion_tokens.
  • mcts: follows tree selection through to a leaf.
  • mars: populates diverse aggregation groups, preserves full agent IDs when applying verification, and matches solution authors across string and integer IDs.
  • bon: excludes truncated and blank candidates.
  • rstar: backpropagates rewards from evaluated rollout nodes and preserves signed and decimal answers.
  • deepconf: votes and calibrates as in the DeepConf reference implementation.
  • entropy_decoding: keeps the nucleus head and applies min_p in sampling.

Project

  • CI now runs every test file, and MCP tests run on pull requests.
  • The README has been streamlined.

Thanks to Parman Mohammadalizadeh, akushonkamen, ZY Liu, flyingdoubleG, and Daniel Peng for their contributions.

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@codelion codelion released this 28 Sep 02:27

What's Changed

Fix: proxy plugin config, logging and agent clients (#330, #331)

  • Proxy target ignored: without ~/.optillm/proxy_config.yaml, the proxy silently loaded the bundled example config and routed to its sample providers. It now creates an empty template instead. A single failed request no longer sends all later traffic to --base-url: 4xx errors don't mark a provider unhealthy, and unhealthy providers are retried before falling back.
  • /v1/models lists the configured providers' models (plus model_map aliases) with --approach proxy.
  • Agent clients (e.g. Crush): the none and proxy approaches now forward the original conversation, including tool_calls and tool results, instead of flattening it. Streamed responses carry tool calls, finish reason and usage. stream_options is no longer forwarded upstream, and messages with content: null no longer crash parsing.
  • Logging: --log / OPTILLM_LOG now apply to all modules and are case-insensitive, so DEBUG logs from the proxy and other plugins show up.

MCP plugin ported to mcp 2.x

  • Works with the MCP Python SDK 2.x (MCPError, snake_case result fields).
  • New streamable_http transport, with headers and timeouts.

Breaking changes

  • MCP websocket transport removed (dropped from the MCP Python SDK in 2.x). Configs using "transport": "websocket" must switch to streamable_http or sse.
  • Requires mcp>=2,<3. Environments that also need mcp<2 won't install.
  • The proxy no longer loads the bundled example_config.yaml when ~/.optillm/proxy_config.yaml is missing. Requests use the server's default client (--base-url) until you add providers.
  • OPTILLM_LOG_LEVEL removed. Use --log / OPTILLM_LOG; monitoring.log_level in the proxy config is an optional proxy-only override.

Thanks to @brettowe for the detailed report.

Full Changelog: v0.3.22...v0.4.0

v0.3.22

Choose a tag to compare

@codelion codelion released this 18 Jul 12:38
c8cbdde

What's Changed

Fix: autothink, thinkdeeper and deepconf for transformers >= 5 (#320)

Since transformers 5, apply_chat_template(return_tensors="pt") returns a BatchEncoding rather than a plain tensor, so passing the result straight to model(input_ids=...) raised. The tensor is now unwrapped via .input_ids:

  • optillm/thinkdeeper.py
  • optillm/autothink/processor.py
  • optillm/deepconf/processor.py

The unwrap is chained with the existing device transfer (.input_ids.to(self.model.device)) so tokens still land on the model's device — Tensor.to() returns a new tensor rather than mutating in place, so the assignment matters on CUDA/MPS.

Thanks to @jacquerie for diagnosing and reporting this.

README: dropped the GitHub stars badge and switched the downloads badge to pepy.tech, which reports actual download counts.

Full Changelog: v0.3.21...v0.3.22

v0.3.21

Choose a tag to compare

@codelion codelion released this 05 Jul 05:41
e5ab29e

What's Changed

Fix: broken PyPI wheel — import optillm failed with ModuleNotFoundError: No module named 'math_verify' (#318)

The published wheel is built from pyproject.toml [project.dependencies], which had drifted from requirements.txt, so pip install optillm shipped a package that couldn't even start:

  • math-verify was missing from pyproject.toml — optillm/cepo/cepo.py imports it at import time, so importing optillm crashed. (Affected 0.3.16–0.3.20.)
  • transformers was unpinned — the <5.13.0 cap added in 0.3.19 only landed in requirements.txt, so PyPI installs pulled transformers 5.13.0 and broke mlx-lm on Apple silicon.

Fix

Synced the runtime deps into pyproject.toml: added math-verify, pinned transformers>=5.0.0,<5.13.0, and outlines[transformers]>=1.2.3.

Verified by building the wheel and installing it into a clean venv (only its declared deps) — import optillm succeeds and transformers resolves to 5.12.x.

If you hit the math_verify import error on 0.3.16–0.3.20, upgrade to 0.3.21.

Full Changelog: v0.3.20...v0.3.21

v0.3.20

Choose a tag to compare

@codelion codelion released this 05 Jul 04:02
205a037

What's Changed

Fix: runaway local generation for models whose ChatML end token differs from their tokenizer EOS (#317)

Running such a model through optillm's built-in local inference never stopped early and generated the full max_new_tokens default (4096) on every call that omitted max_tokens — e.g. dhara-250m's chat ends at <|im_end|> (49154) but its tokenizer eos_token is <|end_of_text|> (1), so it rambled ~800s/call.

  • Honor generation_config.eos_token_id: generation now resolves EOS from the model's own generation config (merging the tokenizer EOS as a fallback) instead of hardcoding tokenizer.eos_token_id. Fixes any chat model with this mismatch; well-behaved models (e.g. Qwen2.5, whose tokenizer EOS already is <|im_end|>) are unchanged.
  • OPTILLM_MAX_TOKENS: new env var to override the default max_new_tokens (default stays 4096), bounding any request that sends no max_tokens. An explicit request max_tokens still takes precedence. Useful for small models that don't reliably emit an EOS token.

Only the local inference engine (OPTILLM_API_KEY=optillm) is affected; proxied providers handle stopping themselves. Includes unit tests for both helpers.

Full Changelog: v0.3.19...v0.3.20

v0.3.19

Choose a tag to compare

@codelion codelion released this 05 Jul 02:19
6a0200c

What's Changed

Fix: import optillm crash on macOS with transformers 5.13 (#316)

A fresh install on Apple silicon crashed with AttributeError: 'str' object has no attribute '__module__' at import optillm.

  • Root cause: transformers 5.13.0 tightened AutoTokenizer.register() to require a class, but mlx-lm 0.31.3 registers a custom tokenizer by string name (tokenizer_utils.py: AutoTokenizer.register("NewlineTokenizer", ...)). transformers ≤5.12.1 tolerated it.
  • macOS-only: optillm installs mlx-lm only on Apple silicon (platform_machine=="arm64" and sys_platform=="darwin"); Linux CI never installs it, so CI was unaffected.
  • Fix: pin transformers>=5.0.0,<5.13.0 (resolves to 5.12.1). The transformers 5.13.0 HF path itself is fine (dhara loads and generates); the incompatibility is purely mlx-lm's. Lift the cap once mlx-lm ships a transformers-5.13-compatible release.

Full Changelog: v0.3.18...v0.3.19

v0.3.18

Choose a tag to compare

@codelion codelion released this 05 Jul 01:49
beca974

What's Changed

Opt-in file persistence for the memory plugin (#111, #315)

The memory plugin can now persist extracted memories across requests. Set OPTILLM_MEMORY_FILE to a path to opt in; when unset, behaviour is byte-for-byte unchanged (in-RAM, reset per request).

  • Loads any previously saved items on init and writes after every add().
  • Atomic writes (temp file + os.replace) so a crash mid-write can't corrupt the store.
  • A missing/corrupt/non-list file degrades gracefully to an empty store — persistence can never fail a request. Loaded items are filtered to strings and bounded by max_size.

CI: Frame SAST scan of PR-changed files

Added a Security Scan (Frame SAST) workflow that runs the Frame neuro-symbolic SAST tool (pinned) on the Python files changed by each pull request. Scanning only changed files surfaces newly introduced issues without failing on pre-existing findings; the job fails only on high/critical severity.

Full Changelog: v0.3.17...v0.3.18

v0.3.17

Choose a tag to compare

@codelion codelion released this 04 Jul 16:43
6901e2d

What's Changed

Fix: MCTS parameters are now request-scoped (#304, #314)

proxy() previously wrote each request's mcts_depth / mcts_exploration / mcts_simulations into the module-level server_config, and execute_single_approach() read them back out of that same global. Under any threaded WSGI server (Flask's default threaded mode, gunicorn, uWSGI, Hypercorn), two concurrent requests raced on that global — request B could overwrite request A's params between A's write and A's read, silently running A's MCTS with B's settings. The write also leaked one request's params into every later request.

MCTS params now flow through the per-request request_config (with the server/CLI defaults as fallback), consistent with every other approach parameter. Behaviour is unchanged for all callers; the shared global is no longer mutated per request, so there is nothing left to race on.

Includes regression tests covering both the per-request read path and the proxy no-mutation guarantee.

Full Changelog: v0.3.16...v0.3.17

v0.3.16

Choose a tag to compare

@codelion codelion released this 03 Jul 11:26
159d340

What's Changed

  • Guard against empty/None/truncated provider responses in rto, self_consistency, reread, leap by @SuperMarioYL in #311

New Contributors

Full Changelog: v0.3.15...v0.3.16

v0.3.15

Choose a tag to compare

@codelion codelion released this 07 May 08:48
df018d6

What's Changed

New Contributors

Full Changelog: v0.3.14...v0.3.15