Releases: mistralai/mistral-common
v1.11.4: Chat templates integration, fixes
What's Changed
- Add chat templates integration by @juliendenize in #163
- Deprecate RawAudio in favor of str | bytes by @juliendenize in #227
- Generalize normalizer aggregation with dual separators by @juliendenize in #235
- Consolidate multimodal ContentChunk support for all message roles by @juliendenize in #241
- Fix
AudioChunk.to_openai()serialization for raw audio bytes and prefixed base64 audio strings. by @haoruilee in #245 - Resolve tokenizer from local cache in offline mode by @sarathfrancis90 in #249
- Remove to_openai and from_openai from InstructRequest by @juliendenize in #251
- Bump version to 1.11.4 by @juliendenize in #252
New Contributors
- @haoruilee made their first contribution in #245
- @sarathfrancis90 made their first contribution in #249
Full Changelog: v1.11.3...v1.11.4
v1.11.3: Fix continue_final_message, add reasoning format to to_openai
What's Changed
- Raise multiple format of reasoning for from_openai by @juliendenize in #224
- Preserve zero OpenAI seed in chat request conversion by @pragnyanramtha in #226
- Pin uv required-version and bump pre-commit hook by @juliendenize in #228
- Add to_openai reasoning format for AssistantMessage by @juliendenize in #223
- fix(tokenizer): point users at from_hf_hub on unknown model (#229) by @NishchayMahor in #231
- Fix: forward continue_final_message in tekken normalizers (V7/V15) by @matdou in #233
- Version 1.11.3 by @juliendenize in #239
New Contributors
- @pragnyanramtha made their first contribution in #226
- @NishchayMahor made their first contribution in #231
- @matdou made their first contribution in #233
Full Changelog: v1.11.2...v1.11.3
v1.11.2: Improve from_openai method.
What's Changed
- Add test and docstring to get_validator by @juliendenize in #219
- Improve from openai methods by @juliendenize in #221
- Version 1.11.2 by @juliendenize in #222
Full Changelog: v1.11.1...v1.11.2
v1.11.1: Patch for agentic use
What's Changed
This Patch allows usage of user message after tool message. It also makes from_openai less strict to make mistral-common integrations in other frameworks smoother.
- Fix docs by @juliendenize in #216
- Allow user message after tool by @juliendenize in #218
- Make from_openai methods lenient by silently dropping unsupported fields by @juliendenize in #217
- Version 1.11.1 by @juliendenize in #220
Full Changelog: v1.11.0...v1.11.1
v1.11.0: Mistral Guidance
What's Changed
Mistral Guidance is out !
Make use of lark grammar to guide your model in generating valid reasoning traces with or without tool calls !
- Improve tool choice by @juliendenize in #204
- Add Mistral guidance by @juliendenize in #202
- Simplify AGENTS.md by @juliendenize in #201
- Add version_num property by @juliendenize in #203
- Update version to 1.11.0 by @juliendenize in #206
Full Changelog: v1.10.0...v1.11.0
v1.10.0: Tokenizer v15, Reasoning Effort and Python 3.14
What's Changed
- Allow System Prompt with Audio for v13 by @juliendenize in #184
- test_audio: Replace live network calls in test_from_url with mocked HTTP responses by @framsouza in #188
- fix: typo in serve command help text by @framsouza in #189
- Add Python 3.14 support by @juliendenize in #195
- test: mock remaining network call in test_encode_invalid_audio_url_chunk by @abdelhadi703 in #192
- [Speech Request] Add speech request by @patrickvonplaten in #196
- Add strict function calling support by @juliendenize in #197
- Add v15 by @juliendenize in #199
- Version 1.10.0 by @juliendenize in #200
New Contributors
- @framsouza made their first contribution in #188
- @abdelhadi703 made their first contribution in #192
Full Changelog: v1.9.1...v1.10.0
v1.9.1 Patch Release
Refactor online streaming processing and allow for dynamic streaming delay
What's Changed
- Add AGENTS.md by @juliendenize in #182
- fix: correct typos 'occurence' and 'recieved' by @thecaptain789 in #185
- [Audio] Refactor streaming logic by @patrickvonplaten in #187
New Contributors
- @thecaptain789 made their first contribution in #185
Full Changelog: v1.9.0...v1.9.1
v1.9.0 - Stream my audio 🎙️
Mistral-Common can now process streaming requests
import numpy as np
from mistral_common.audio import Audio
from mistral_common.protocol.instruct.chunk import RawAudio
from mistral_common.protocol.transcription.request import (
StreamingMode,
TranscriptionRequest,
)
from mistral_common.tokens.tokenizers.mistral import MistralTokenizer
# 1. Load the tokenizer with audio support
tokenizer = MistralTokenizer.from_hf_hub(
"mistralai/Voxtral-Mini-4B-Realtime-2602"
)
# 2. Create sample audio data (or load from a file)
sampling_rate = 16_000
duration_s = 2.0
audio_array = np.random.uniform(-1, 1, size=int(duration_s * sampling_rate)).astype(np.float32)
audio = Audio(
audio_array=audio_array,
sampling_rate=sampling_rate,
format="wav",
)
# 3. Create the streaming transcription request
request = TranscriptionRequest(
audio=RawAudio(
data=audio.to_base64("wav"),
format="wav",
),
streaming=StreamingMode.ONLINE, # or StreamingMode.OFFLINE
language=None,
)
# 4. Encode the request
tokenized = tokenizer.encode_transcription(request)
# 5. Access the results
print(f"Tokens: {tokenized.tokens}")
print(f"Number of tokens: {len(tokenized.tokens)}")
print(f"Number of audio segments: {len(tokenized.audios)}")See https://huggingface.co/mistralai/Voxtral-Mini-4B-Realtime-2602 for more info.
What's Changed
- Add new token logic asrstr by @patrickvonplaten in #172
- [Backward comp] Still need the _control_tokens for vLLM by @patrickvonplaten in #173
- Release 1.8.8 by @juliendenize in #174
- [Audio] Update padding by @patrickvonplaten in #175
- [Audio] Improve padding for streaming by @patrickvonplaten in #177
- Add audio_encoder to Tokenizer V13 by @amosyou in #180
- Release v1.9.0 - Audio streaming by @patrickvonplaten in #179
- Fix image tests with downloads by @juliendenize in #181
- Enhance accessibility by @juliendenize in #176
New Contributors
Full Changelog: v1.8.7...v1.9.0
v1.8.8: Backward comp
What's Changed
- Add new token logic asrstr by @patrickvonplaten in #172
- [Backward comp] Still need the _control_tokens for vLLM by @patrickvonplaten in #173
Full Changelog: v1.8.7...v1.8.8
v1.8.7: Refactoring and bug fixes.
What's Changed
- Remove the index field from assistant tool_calls. by @tobrun in #165
- Rename get control -> to get special & add is_special by @patrickvonplaten in #164
- Add TextChunk support to ToolMessage by @juliendenize in #170
- Version 1.8.7 by @juliendenize in #171
New Contributors
Full Changelog: v1.8.6...v1.8.7