swarmauri_llm_mistral 0.1.1.dev2__tar.gz → 0.11.0.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- swarmauri_llm_mistral-0.11.0.dev1/PKG-INFO +218 -0
- swarmauri_llm_mistral-0.11.0.dev1/README.md +185 -0
- {swarmauri_llm_mistral-0.1.1.dev2 → swarmauri_llm_mistral-0.11.0.dev1}/pyproject.toml +20 -3
- swarmauri_llm_mistral-0.1.1.dev2/PKG-INFO +0 -86
- swarmauri_llm_mistral-0.1.1.dev2/README.md +0 -57
- {swarmauri_llm_mistral-0.1.1.dev2 → swarmauri_llm_mistral-0.11.0.dev1}/LICENSE +0 -0
- {swarmauri_llm_mistral-0.1.1.dev2 → swarmauri_llm_mistral-0.11.0.dev1}/swarmauri_llm_mistral/MistralModel.py +0 -0
- {swarmauri_llm_mistral-0.1.1.dev2 → swarmauri_llm_mistral-0.11.0.dev1}/swarmauri_llm_mistral/MistralToolModel.py +0 -0
- {swarmauri_llm_mistral-0.1.1.dev2 → swarmauri_llm_mistral-0.11.0.dev1}/swarmauri_llm_mistral/__init__.py +0 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: swarmauri_llm_mistral
|
|
3
|
+
Version: 0.11.0.dev1
|
|
4
|
+
Summary: Provider-specific Swarmauri import package for Mistral chat, tool-calling, streaming, async, and batch LLM workflows.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: swarmauri,llm,swarmauri llm,mistral,mistral ai,tool calling,function calling,chat completions,streaming llm,async llm,batch inference,codestral,pixtral,devstral,large language model,generative ai,model
|
|
8
|
+
Author: Jacob Stewart
|
|
9
|
+
Author-email: jacob@swarmauri.com
|
|
10
|
+
Requires-Python: >=3.10,<3.15
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Natural Language :: English
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
|
+
Classifier: Programming Language :: Python
|
|
21
|
+
Classifier: Programming Language :: Python :: 3
|
|
22
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
28
|
+
Requires-Dist: swarmauri_base
|
|
29
|
+
Requires-Dist: swarmauri_core
|
|
30
|
+
Requires-Dist: swarmauri_standard
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<a href="https://pepy.tech/project/swarmauri_llm_mistral/">
|
|
37
|
+
<img src="https://static.pepy.tech/badge/swarmauri_llm_mistral/month" alt="PyPI - Downloads"/></a>
|
|
38
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral/">
|
|
39
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral.svg"/></a>
|
|
40
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
41
|
+
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
42
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
43
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_llm_mistral" alt="PyPI - License"/></a>
|
|
44
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
45
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_llm_mistral?label=swarmauri_llm_mistral&color=green" alt="PyPI - swarmauri_llm_mistral"/></a>
|
|
46
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
47
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
48
|
+
|
|
49
|
+
# Swarmauri Mistral LLM
|
|
50
|
+
|
|
51
|
+
`swarmauri_llm_mistral` provides provider-specific Swarmauri imports for the Mistral API. The package exposes `MistralModel` for chat completion workflows and `MistralToolModel` for tool-calling workflows that execute toolkit functions and optionally follow up with a second model turn.
|
|
52
|
+
|
|
53
|
+
The runtime targets Mistral's hosted API at `https://api.mistral.ai/v1/`, supports the current allowlisted Mistral, Magistral, Codestral, Devstral, Pixtral, OCR, embedding, and moderation model families tracked in the repo, and preserves Swarmauri `Conversation` and toolkit semantics.
|
|
54
|
+
|
|
55
|
+
## Why Use This Package?
|
|
56
|
+
|
|
57
|
+
- Keep Mistral-specific imports explicit in Swarmauri applications.
|
|
58
|
+
- Use a chat model adapter and a separate tool-calling adapter that match Swarmauri’s `llms` and `tool_llms` package boundaries.
|
|
59
|
+
- Support sync, async, streaming, and batch generation workflows against the Mistral API.
|
|
60
|
+
- Execute tools through `MistralToolModel` without hand-writing provider-specific function-calling payloads.
|
|
61
|
+
|
|
62
|
+
## FAQ
|
|
63
|
+
|
|
64
|
+
### What does `swarmauri_llm_mistral` install?
|
|
65
|
+
|
|
66
|
+
It installs `MistralModel` under `swarmauri.llms` and `MistralToolModel` under `swarmauri.tool_llms`.
|
|
67
|
+
|
|
68
|
+
### Which Mistral capabilities are wrapped today?
|
|
69
|
+
|
|
70
|
+
`MistralModel` wraps chat completion workflows, including streaming and optional JSON response formatting. `MistralToolModel` wraps tool-calling workflows that serialize Swarmauri tools into Mistral-compatible schemas, execute tool calls, and optionally request a final assistant answer in a second turn.
|
|
71
|
+
|
|
72
|
+
### Does it support usage metadata?
|
|
73
|
+
|
|
74
|
+
`MistralModel` can attach Swarmauri `UsageData` when usage information is returned and `include_usage` is enabled.
|
|
75
|
+
|
|
76
|
+
### Does `MistralToolModel` support streaming?
|
|
77
|
+
|
|
78
|
+
Yes. The tool model performs the tool-call round first, appends tool results to the conversation, then streams the final assistant response when streaming is requested.
|
|
79
|
+
|
|
80
|
+
### Which model families are covered?
|
|
81
|
+
|
|
82
|
+
The current allowlists include Mistral chat models plus related families such as Magistral, Codestral, Devstral, Pixtral, OCR, embed, and moderation surfaces tracked in the runtime code.
|
|
83
|
+
|
|
84
|
+
### Where should I verify current model and pricing details?
|
|
85
|
+
|
|
86
|
+
Use the provider documentation links in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), especially the Mistral models, function-calling, and pricing pages, before publishing model availability or pricing claims.
|
|
87
|
+
|
|
88
|
+
## Features
|
|
89
|
+
|
|
90
|
+
- `MistralModel` for sync, async, streaming, and batch chat completion workflows.
|
|
91
|
+
- Optional JSON response mode and safe prompt support on chat requests.
|
|
92
|
+
- `MistralToolModel` for tool-calling and multiturn tool execution workflows.
|
|
93
|
+
- Current repo-tracked allowlists for Mistral, Magistral, Codestral, Devstral, Pixtral, OCR, embed, and moderation models.
|
|
94
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
95
|
+
|
|
96
|
+
## Installation
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
uv add swarmauri_llm_mistral
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install swarmauri_llm_mistral
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Usage
|
|
107
|
+
|
|
108
|
+
Set `MISTRAL_API_KEY` in your environment before creating the model.
|
|
109
|
+
|
|
110
|
+
### Chat Completion
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import os
|
|
114
|
+
|
|
115
|
+
from swarmauri_llm_mistral import MistralModel
|
|
116
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
117
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
118
|
+
|
|
119
|
+
conversation = Conversation()
|
|
120
|
+
conversation.add_message(HumanMessage(content="Summarize Swarmauri in two sentences."))
|
|
121
|
+
|
|
122
|
+
model = MistralModel(
|
|
123
|
+
api_key=os.environ["MISTRAL_API_KEY"],
|
|
124
|
+
name="mistral-medium-2508",
|
|
125
|
+
)
|
|
126
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
127
|
+
|
|
128
|
+
print(result.get_last().content)
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Streaming
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
import os
|
|
135
|
+
|
|
136
|
+
from swarmauri_llm_mistral import MistralModel
|
|
137
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
138
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
139
|
+
|
|
140
|
+
conversation = Conversation()
|
|
141
|
+
conversation.add_message(HumanMessage(content="Write a short haiku about AI tooling."))
|
|
142
|
+
|
|
143
|
+
model = MistralModel(api_key=os.environ["MISTRAL_API_KEY"])
|
|
144
|
+
|
|
145
|
+
for token in model.stream(conversation=conversation):
|
|
146
|
+
print(token, end="", flush=True)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Tool Calling
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
import os
|
|
153
|
+
|
|
154
|
+
from swarmauri_llm_mistral import MistralToolModel
|
|
155
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
156
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
157
|
+
from swarmauri_standard.toolkits.Toolkit import Toolkit
|
|
158
|
+
from swarmauri_standard.tools.AdditionTool import AdditionTool
|
|
159
|
+
|
|
160
|
+
conversation = Conversation()
|
|
161
|
+
conversation.add_message(HumanMessage(content="What is 19 + 23? Use the tool."))
|
|
162
|
+
|
|
163
|
+
toolkit = Toolkit(tools={"add": AdditionTool()})
|
|
164
|
+
|
|
165
|
+
model = MistralToolModel(
|
|
166
|
+
api_key=os.environ["MISTRAL_API_KEY"],
|
|
167
|
+
name="mistral-medium-2508",
|
|
168
|
+
)
|
|
169
|
+
result = model.predict(
|
|
170
|
+
conversation=conversation,
|
|
171
|
+
toolkit=toolkit,
|
|
172
|
+
tool_choice="auto",
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
print(result.get_last().content)
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Examples
|
|
179
|
+
|
|
180
|
+
- Use `MistralModel` for standard chat completion workflows when you want a direct Mistral provider package import.
|
|
181
|
+
- Use `MistralToolModel` when the application needs function calling and tool execution through a Swarmauri toolkit.
|
|
182
|
+
- Use `enable_json=True` on `MistralModel` when downstream code expects structured JSON output.
|
|
183
|
+
|
|
184
|
+
## Related Packages
|
|
185
|
+
|
|
186
|
+
- [swarmauri_llm_openai](https://pypi.org/project/swarmauri_llm_openai/)
|
|
187
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
188
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
189
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
190
|
+
- [swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
191
|
+
- [swarmauri_llm_llamacpp](https://pypi.org/project/swarmauri_llm_llamacpp/)
|
|
192
|
+
|
|
193
|
+
## Foundational Swarmauri Packages
|
|
194
|
+
|
|
195
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
196
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
197
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
198
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
199
|
+
|
|
200
|
+
## More Documentation
|
|
201
|
+
|
|
202
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
203
|
+
- [Mistral models](https://docs.mistral.ai/models)
|
|
204
|
+
- [Mistral function calling](https://docs.mistral.ai/capabilities/function_calling/)
|
|
205
|
+
|
|
206
|
+
## Best Practices
|
|
207
|
+
|
|
208
|
+
- Keep `MISTRAL_API_KEY` in environment variables or a secret manager.
|
|
209
|
+
- Validate model availability against Mistral’s current catalog before hard-coding a specific family into production workflows.
|
|
210
|
+
- Use `MistralToolModel` only when a toolkit-backed tool loop is actually needed; plain chat is simpler with `MistralModel`.
|
|
211
|
+
- Tune `temperature`, `top_p`, `max_tokens`, and `safe_prompt` to match your product constraints.
|
|
212
|
+
|
|
213
|
+
## License
|
|
214
|
+
|
|
215
|
+
Apache-2.0
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<a href="https://pepy.tech/project/swarmauri_llm_mistral/">
|
|
5
|
+
<img src="https://static.pepy.tech/badge/swarmauri_llm_mistral/month" alt="PyPI - Downloads"/></a>
|
|
6
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral/">
|
|
7
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral.svg"/></a>
|
|
8
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
9
|
+
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
10
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
11
|
+
<img src="https://img.shields.io/pypi/l/swarmauri_llm_mistral" alt="PyPI - License"/></a>
|
|
12
|
+
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
13
|
+
<img src="https://img.shields.io/pypi/v/swarmauri_llm_mistral?label=swarmauri_llm_mistral&color=green" alt="PyPI - swarmauri_llm_mistral"/></a>
|
|
14
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
15
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
16
|
+
|
|
17
|
+
# Swarmauri Mistral LLM
|
|
18
|
+
|
|
19
|
+
`swarmauri_llm_mistral` provides provider-specific Swarmauri imports for the Mistral API. The package exposes `MistralModel` for chat completion workflows and `MistralToolModel` for tool-calling workflows that execute toolkit functions and optionally follow up with a second model turn.
|
|
20
|
+
|
|
21
|
+
The runtime targets Mistral's hosted API at `https://api.mistral.ai/v1/`, supports the current allowlisted Mistral, Magistral, Codestral, Devstral, Pixtral, OCR, embedding, and moderation model families tracked in the repo, and preserves Swarmauri `Conversation` and toolkit semantics.
|
|
22
|
+
|
|
23
|
+
## Why Use This Package?
|
|
24
|
+
|
|
25
|
+
- Keep Mistral-specific imports explicit in Swarmauri applications.
|
|
26
|
+
- Use a chat model adapter and a separate tool-calling adapter that match Swarmauri’s `llms` and `tool_llms` package boundaries.
|
|
27
|
+
- Support sync, async, streaming, and batch generation workflows against the Mistral API.
|
|
28
|
+
- Execute tools through `MistralToolModel` without hand-writing provider-specific function-calling payloads.
|
|
29
|
+
|
|
30
|
+
## FAQ
|
|
31
|
+
|
|
32
|
+
### What does `swarmauri_llm_mistral` install?
|
|
33
|
+
|
|
34
|
+
It installs `MistralModel` under `swarmauri.llms` and `MistralToolModel` under `swarmauri.tool_llms`.
|
|
35
|
+
|
|
36
|
+
### Which Mistral capabilities are wrapped today?
|
|
37
|
+
|
|
38
|
+
`MistralModel` wraps chat completion workflows, including streaming and optional JSON response formatting. `MistralToolModel` wraps tool-calling workflows that serialize Swarmauri tools into Mistral-compatible schemas, execute tool calls, and optionally request a final assistant answer in a second turn.
|
|
39
|
+
|
|
40
|
+
### Does it support usage metadata?
|
|
41
|
+
|
|
42
|
+
`MistralModel` can attach Swarmauri `UsageData` when usage information is returned and `include_usage` is enabled.
|
|
43
|
+
|
|
44
|
+
### Does `MistralToolModel` support streaming?
|
|
45
|
+
|
|
46
|
+
Yes. The tool model performs the tool-call round first, appends tool results to the conversation, then streams the final assistant response when streaming is requested.
|
|
47
|
+
|
|
48
|
+
### Which model families are covered?
|
|
49
|
+
|
|
50
|
+
The current allowlists include Mistral chat models plus related families such as Magistral, Codestral, Devstral, Pixtral, OCR, embed, and moderation surfaces tracked in the runtime code.
|
|
51
|
+
|
|
52
|
+
### Where should I verify current model and pricing details?
|
|
53
|
+
|
|
54
|
+
Use the provider documentation links in [docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md), especially the Mistral models, function-calling, and pricing pages, before publishing model availability or pricing claims.
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
- `MistralModel` for sync, async, streaming, and batch chat completion workflows.
|
|
59
|
+
- Optional JSON response mode and safe prompt support on chat requests.
|
|
60
|
+
- `MistralToolModel` for tool-calling and multiturn tool execution workflows.
|
|
61
|
+
- Current repo-tracked allowlists for Mistral, Magistral, Codestral, Devstral, Pixtral, OCR, embed, and moderation models.
|
|
62
|
+
- Compatibility with Python 3.10, 3.11, 3.12, 3.13, and 3.14.
|
|
63
|
+
|
|
64
|
+
## Installation
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
uv add swarmauri_llm_mistral
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
pip install swarmauri_llm_mistral
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Usage
|
|
75
|
+
|
|
76
|
+
Set `MISTRAL_API_KEY` in your environment before creating the model.
|
|
77
|
+
|
|
78
|
+
### Chat Completion
|
|
79
|
+
|
|
80
|
+
```python
|
|
81
|
+
import os
|
|
82
|
+
|
|
83
|
+
from swarmauri_llm_mistral import MistralModel
|
|
84
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
85
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
86
|
+
|
|
87
|
+
conversation = Conversation()
|
|
88
|
+
conversation.add_message(HumanMessage(content="Summarize Swarmauri in two sentences."))
|
|
89
|
+
|
|
90
|
+
model = MistralModel(
|
|
91
|
+
api_key=os.environ["MISTRAL_API_KEY"],
|
|
92
|
+
name="mistral-medium-2508",
|
|
93
|
+
)
|
|
94
|
+
result = model.predict(conversation=conversation, max_tokens=200)
|
|
95
|
+
|
|
96
|
+
print(result.get_last().content)
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Streaming
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
import os
|
|
103
|
+
|
|
104
|
+
from swarmauri_llm_mistral import MistralModel
|
|
105
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
106
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
107
|
+
|
|
108
|
+
conversation = Conversation()
|
|
109
|
+
conversation.add_message(HumanMessage(content="Write a short haiku about AI tooling."))
|
|
110
|
+
|
|
111
|
+
model = MistralModel(api_key=os.environ["MISTRAL_API_KEY"])
|
|
112
|
+
|
|
113
|
+
for token in model.stream(conversation=conversation):
|
|
114
|
+
print(token, end="", flush=True)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Tool Calling
|
|
118
|
+
|
|
119
|
+
```python
|
|
120
|
+
import os
|
|
121
|
+
|
|
122
|
+
from swarmauri_llm_mistral import MistralToolModel
|
|
123
|
+
from swarmauri_standard.conversations.Conversation import Conversation
|
|
124
|
+
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
125
|
+
from swarmauri_standard.toolkits.Toolkit import Toolkit
|
|
126
|
+
from swarmauri_standard.tools.AdditionTool import AdditionTool
|
|
127
|
+
|
|
128
|
+
conversation = Conversation()
|
|
129
|
+
conversation.add_message(HumanMessage(content="What is 19 + 23? Use the tool."))
|
|
130
|
+
|
|
131
|
+
toolkit = Toolkit(tools={"add": AdditionTool()})
|
|
132
|
+
|
|
133
|
+
model = MistralToolModel(
|
|
134
|
+
api_key=os.environ["MISTRAL_API_KEY"],
|
|
135
|
+
name="mistral-medium-2508",
|
|
136
|
+
)
|
|
137
|
+
result = model.predict(
|
|
138
|
+
conversation=conversation,
|
|
139
|
+
toolkit=toolkit,
|
|
140
|
+
tool_choice="auto",
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
print(result.get_last().content)
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
## Examples
|
|
147
|
+
|
|
148
|
+
- Use `MistralModel` for standard chat completion workflows when you want a direct Mistral provider package import.
|
|
149
|
+
- Use `MistralToolModel` when the application needs function calling and tool execution through a Swarmauri toolkit.
|
|
150
|
+
- Use `enable_json=True` on `MistralModel` when downstream code expects structured JSON output.
|
|
151
|
+
|
|
152
|
+
## Related Packages
|
|
153
|
+
|
|
154
|
+
- [swarmauri_llm_openai](https://pypi.org/project/swarmauri_llm_openai/)
|
|
155
|
+
- [swarmauri_llm_groq](https://pypi.org/project/swarmauri_llm_groq/)
|
|
156
|
+
- [swarmauri_llm_hyperbolic](https://pypi.org/project/swarmauri_llm_hyperbolic/)
|
|
157
|
+
- [swarmauri_llm_deepinfra](https://pypi.org/project/swarmauri_llm_deepinfra/)
|
|
158
|
+
- [swarmauri_llm_perplexity](https://pypi.org/project/swarmauri_llm_perplexity/)
|
|
159
|
+
- [swarmauri_llm_llamacpp](https://pypi.org/project/swarmauri_llm_llamacpp/)
|
|
160
|
+
|
|
161
|
+
## Foundational Swarmauri Packages
|
|
162
|
+
|
|
163
|
+
- [swarmauri](https://pypi.org/project/swarmauri/)
|
|
164
|
+
- [swarmauri_core](https://pypi.org/project/swarmauri_core/)
|
|
165
|
+
- [swarmauri_base](https://pypi.org/project/swarmauri_base/)
|
|
166
|
+
- [swarmauri_standard](https://pypi.org/project/swarmauri_standard/)
|
|
167
|
+
|
|
168
|
+
## More Documentation
|
|
169
|
+
|
|
170
|
+
- [LLM provider model and pricing links](../../../docs/LLM_PROVIDER_MODEL_PRICING_LINKS.md)
|
|
171
|
+
- [Mistral models](https://docs.mistral.ai/models)
|
|
172
|
+
- [Mistral function calling](https://docs.mistral.ai/capabilities/function_calling/)
|
|
173
|
+
|
|
174
|
+
## Best Practices
|
|
175
|
+
|
|
176
|
+
- Keep `MISTRAL_API_KEY` in environment variables or a secret manager.
|
|
177
|
+
- Validate model availability against Mistral’s current catalog before hard-coding a specific family into production workflows.
|
|
178
|
+
- Use `MistralToolModel` only when a toolkit-backed tool loop is actually needed; plain chat is simpler with `MistralModel`.
|
|
179
|
+
- Tune `temperature`, `top_p`, `max_tokens`, and `safe_prompt` to match your product constraints.
|
|
180
|
+
|
|
181
|
+
## License
|
|
182
|
+
|
|
183
|
+
Apache-2.0
|
|
184
|
+
|
|
185
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_llm_mistral"
|
|
3
|
-
version = "0.
|
|
4
|
-
description = "Swarmauri Mistral
|
|
3
|
+
version = "0.11.0.dev1"
|
|
4
|
+
description = "Provider-specific Swarmauri import package for Mistral chat, tool-calling, streaming, async, and batch LLM workflows."
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
repository = "http://github.com/swarmauri/swarmauri-sdk"
|
|
@@ -11,6 +11,10 @@ classifiers = [
|
|
|
11
11
|
"Natural Language :: English",
|
|
12
12
|
"Development Status :: 3 - Alpha",
|
|
13
13
|
"Intended Audience :: Developers",
|
|
14
|
+
"Intended Audience :: Science/Research",
|
|
15
|
+
"Operating System :: OS Independent",
|
|
16
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
17
|
+
"Topic :: Software Development :: Libraries",
|
|
14
18
|
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
15
19
|
"Programming Language :: Python",
|
|
16
20
|
"Programming Language :: Python :: 3",
|
|
@@ -30,7 +34,20 @@ dependencies = [
|
|
|
30
34
|
keywords = [
|
|
31
35
|
"swarmauri",
|
|
32
36
|
"llm",
|
|
37
|
+
"swarmauri llm",
|
|
33
38
|
"mistral",
|
|
39
|
+
"mistral ai",
|
|
40
|
+
"tool calling",
|
|
41
|
+
"function calling",
|
|
42
|
+
"chat completions",
|
|
43
|
+
"streaming llm",
|
|
44
|
+
"async llm",
|
|
45
|
+
"batch inference",
|
|
46
|
+
"codestral",
|
|
47
|
+
"pixtral",
|
|
48
|
+
"devstral",
|
|
49
|
+
"large language model",
|
|
50
|
+
"generative ai",
|
|
34
51
|
"model",
|
|
35
52
|
]
|
|
36
53
|
|
|
@@ -76,7 +93,7 @@ dev = [
|
|
|
76
93
|
"pytest-xdist>=3.6.1",
|
|
77
94
|
"pytest-json-report>=1.5.0",
|
|
78
95
|
"python-dotenv",
|
|
79
|
-
"
|
|
96
|
+
"httpx>=0.27",
|
|
80
97
|
"flake8>=7.0",
|
|
81
98
|
"pytest-timeout>=2.3.1",
|
|
82
99
|
"ruff>=0.9.9",
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: swarmauri_llm_mistral
|
|
3
|
-
Version: 0.1.1.dev2
|
|
4
|
-
Summary: Swarmauri Mistral LLM adapters from swarmauri_standard.
|
|
5
|
-
License-Expression: Apache-2.0
|
|
6
|
-
License-File: LICENSE
|
|
7
|
-
Keywords: swarmauri,llm,mistral,model
|
|
8
|
-
Author: Jacob Stewart
|
|
9
|
-
Author-email: jacob@swarmauri.com
|
|
10
|
-
Requires-Python: >=3.10,<3.15
|
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
-
Classifier: Natural Language :: English
|
|
13
|
-
Classifier: Development Status :: 3 - Alpha
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
16
|
-
Classifier: Programming Language :: Python
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
-
Requires-Dist: swarmauri_base
|
|
25
|
-
Requires-Dist: swarmauri_core
|
|
26
|
-
Requires-Dist: swarmauri_standard
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-

|
|
30
|
-
|
|
31
|
-
<p align="center">
|
|
32
|
-
<a href="https://pepy.tech/project/swarmauri_llm_mistral/">
|
|
33
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_mistral/month" alt="PyPI - Downloads"/></a>
|
|
34
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral/">
|
|
35
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral.svg"/></a>
|
|
36
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
37
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
38
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
39
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_mistral" alt="PyPI - License"/></a>
|
|
40
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
41
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_mistral?label=swarmauri_llm_mistral&color=green" alt="PyPI - swarmauri_llm_mistral"/></a>
|
|
42
|
-
</p>
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
# swarmauri_llm_mistral
|
|
46
|
-
|
|
47
|
-
Provider-specific Mistral LLM package for Swarmauri. This package offers direct imports for MistralModel, MistralToolModel while keeping implementation parity with `swarmauri_standard`.
|
|
48
|
-
|
|
49
|
-
## Features
|
|
50
|
-
|
|
51
|
-
- `MistralModel` adapter exported from `swarmauri_standard.llms.MistralModel`.
|
|
52
|
-
- `MistralToolModel` adapter exported from `swarmauri_standard.llms.MistralToolModel`.
|
|
53
|
-
- Compatible with Python 3.10 through 3.12.
|
|
54
|
-
|
|
55
|
-
## Installation
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
# uv
|
|
59
|
-
uv add swarmauri_llm_mistral
|
|
60
|
-
|
|
61
|
-
# pip
|
|
62
|
-
pip install swarmauri_llm_mistral
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Usage
|
|
66
|
-
|
|
67
|
-
```python
|
|
68
|
-
from swarmauri_llm_mistral import MistralModel
|
|
69
|
-
from swarmauri_llm_mistral import MistralToolModel
|
|
70
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
71
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
72
|
-
|
|
73
|
-
conversation = Conversation()
|
|
74
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
75
|
-
|
|
76
|
-
model = MistralModel()
|
|
77
|
-
# Configure provider credentials before making requests.
|
|
78
|
-
# result = model.predict(conversation=conversation)
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Workflow Notes
|
|
82
|
-
|
|
83
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
84
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
85
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
86
|
-
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-

|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<a href="https://pepy.tech/project/swarmauri_llm_mistral/">
|
|
5
|
-
<img src="https://static.pepy.tech/badge/swarmauri_llm_mistral/month" alt="PyPI - Downloads"/></a>
|
|
6
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral/">
|
|
7
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/community/swarmauri_llm_mistral.svg"/></a>
|
|
8
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
9
|
-
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
10
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
11
|
-
<img src="https://img.shields.io/pypi/l/swarmauri_llm_mistral" alt="PyPI - License"/></a>
|
|
12
|
-
<a href="https://pypi.org/project/swarmauri_llm_mistral/">
|
|
13
|
-
<img src="https://img.shields.io/pypi/v/swarmauri_llm_mistral?label=swarmauri_llm_mistral&color=green" alt="PyPI - swarmauri_llm_mistral"/></a>
|
|
14
|
-
</p>
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
# swarmauri_llm_mistral
|
|
18
|
-
|
|
19
|
-
Provider-specific Mistral LLM package for Swarmauri. This package offers direct imports for MistralModel, MistralToolModel while keeping implementation parity with `swarmauri_standard`.
|
|
20
|
-
|
|
21
|
-
## Features
|
|
22
|
-
|
|
23
|
-
- `MistralModel` adapter exported from `swarmauri_standard.llms.MistralModel`.
|
|
24
|
-
- `MistralToolModel` adapter exported from `swarmauri_standard.llms.MistralToolModel`.
|
|
25
|
-
- Compatible with Python 3.10 through 3.12.
|
|
26
|
-
|
|
27
|
-
## Installation
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
# uv
|
|
31
|
-
uv add swarmauri_llm_mistral
|
|
32
|
-
|
|
33
|
-
# pip
|
|
34
|
-
pip install swarmauri_llm_mistral
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Usage
|
|
38
|
-
|
|
39
|
-
```python
|
|
40
|
-
from swarmauri_llm_mistral import MistralModel
|
|
41
|
-
from swarmauri_llm_mistral import MistralToolModel
|
|
42
|
-
from swarmauri_standard.conversations.Conversation import Conversation
|
|
43
|
-
from swarmauri_standard.messages.HumanMessage import HumanMessage
|
|
44
|
-
|
|
45
|
-
conversation = Conversation()
|
|
46
|
-
conversation.add_message(HumanMessage(content="Hello from Swarmauri"))
|
|
47
|
-
|
|
48
|
-
model = MistralModel()
|
|
49
|
-
# Configure provider credentials before making requests.
|
|
50
|
-
# result = model.predict(conversation=conversation)
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Workflow Notes
|
|
54
|
-
|
|
55
|
-
- These adapters intentionally mirror the corresponding classes in `swarmauri_standard`.
|
|
56
|
-
- Use the provider package that matches your deployment and credential setup.
|
|
57
|
-
- Install only the provider packages you need to keep dependencies minimal.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|