Download Latest Version v2.1.0 source code.tar.gz (147.2 MB)
Email in envelope

Get an email when there's a new version of LLM.swift

Home / v2.1.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2025-12-06 981 Bytes
v2.1.0 source code.tar.gz 2025-12-06 147.2 MB
v2.1.0 source code.zip 2025-12-06 147.4 MB
Totals: 3 Items   294.6 MB 0

v2.1.0

Thinking Output Separation

You can now access the model's reasoning process separately from the final response.

Usage

:::swift
await bot.respond(to: "What is 2+2?", thinking: .enabled)

print(bot.thinking)  // Model's reasoning process
print(bot.output)    // Final answer

ThinkingMode

Mode Behavior
.none Default. No special handling.
.enabled Streams thinking and response separately.
.suppressed Injects empty thinking tokens to skip reasoning.

Compatibility

This feature works best with models that have native thinking token support (e.g., Qwen, DeepSeek-R1).

For models without dedicated thinking tokens, the library uses string-based marker detection which may still work, but performance improvements are not guaranteed. Experimentation is recommended.

Full Changelog: https://github.com/eastriverlee/LLM.swift/compare/v2.0.2...v2.1.0

Source: README.md, updated 2025-12-06