Releases: zhudotexe/kani
Releases · zhudotexe/kani
v1.3.0
Enhancements
- Added
ToolCallParser
s -- these classes are wrappers around KaniEngine
s that parse raw text generated by a model, and return Kani-format tool calls. This is an easy way to enable tool calling on open-source models!
Example:
from kani.engines.huggingface import HuggingEngine
from kani.prompts.impl.mistral import MISTRAL_V3_PIPELINE
from kani.tool_parsers.mistral import MistralToolCallParser
model = HuggingEngine(model_id="mistralai/Mistral-Small-Instruct-2409", prompt_pipeline=MISTRAL_V3_PIPELINE)
engine = MistralToolCallParser(model)
- Added
NaiveJSONToolCallParser
(e.g., Llama 3) - Added
MistralToolCallParser
- Added
DeepseekR1ToolCallParser
Bug Fixes et al.
- Fix compatibility issues with Pydantic 2.10
- Update documentation to better reflect supported HF models
v1.2.4
v1.2.3
v1.2.2
- fix(mistral): ensure prompt and completion tokens are passed through in the MistralFunctionCallingAdapter when streaming
- fix(streaming): don't emit text in DummyStream if it is None
- feat: add standalone width formatters
- docs: gpt-3.5-turbo -> gpt-4o-mini defaults
- fix(streaming): potential line len miscount in format_stream
v1.2.1
- Fixes various issues in the
MistralFunctionCallingAdapter
wrapper engine for Mistral-Large and Mistral-Small function calling models. - Fixes an issue in
PromptPipeline.explain()
where manual examples would not be explained. - Fixes an issue in
PromptPipeline.ensure_bound_function_calls()
where passing an ID translator would mutate the ID of the underlying messages
v1.2.0
New Features
- Hugging Face: Models loaded through the
HuggingEngine
now use chat templates for conversational prompting and tool usage if available by default. This should make it much easier to get started with a Hugging Face model in Kani. - Added the ability to supply a custom tokenizer to the
OpenAIEngine
(e.g., for using OpenAI-compatible APIs)\
Fixes/Improvements
- Fixed a missing dependency in the
llama
extra - The
HuggingEngine
will now automatically setdevice_map="auto"
if theaccelerate
library is installed
v1.1.1
v1.1.0
- Added
max_function_rounds
toKani.full_round
,Kani.full_round_str
, andKani.full_round_stream
:The maximum number of function calling rounds to perform in this round. If this number is reached, the model is allowed to generate a final response without any functions defined.
Default unlimited (continues until model's response does not contain a function call). - Added
__repr__
to engines - Fixed an issue where Kani could underestimate the token usage for certain OpenAI models using parallel function calling
v1.0.2
- Add
Kani.add_completion_to_history
(useful for token counting, see #29) - Add an example of an AIFunction definition to
PromptPipeline.explain()
when a function-related step is included - Add
id_translator
arg toPromptPipeline.ensure_bound_function_calls()
- Ensure that OpenAIEngine and HuggingEngine streams yield a completion including prompt and completion token usage
- Various Mistral-7B Instruct v0.3 prompt fixes