Skip to content

Commit f4a7030

Browse files
authored
Upgrade MiniMax default model to MiniMax-M3 in dagworks RAG examples (#1620)
* Upgrade MiniMax model default to MiniMax-M3 in dagworks RAG modules Updates the default model returned by `model__minimax()` in the `conversational_rag` and `faiss_rag` dataflows from `MiniMax-M2.7` to `MiniMax-M3`. The base URL (`https://api.minimax.io/v1`) and the OpenAI-compatible client wiring stay the same; only the model ID constant and its references in tests/README change. - contrib/hamilton/contrib/dagworks/conversational_rag/__init__.py: `model__minimax()` now returns `MiniMax-M3`. - contrib/hamilton/contrib/dagworks/faiss_rag/__init__.py: `model__minimax()` now returns `MiniMax-M3`. - Unit tests updated to assert the new model constant and to pass `MiniMax-M3` into mocked chat completion calls. - README config tables and "uses the [MiniMax-...] model" lines refreshed to reference MiniMax-M3. Co-Authored-By: Octopus <liyuan851277048@icloud.com> Signed-off-by: Octopus <liyuan851277048@icloud.com> * docs: correct MiniMax context window (M3=512K, M2.7=192K; was mistakenly 1M) * docs: correct MiniMax context window (M3=512K, M2.7=192K; was mistakenly 1M) --------- Signed-off-by: Octopus <liyuan851277048@icloud.com>
1 parent f39b210 commit f4a7030

6 files changed

Lines changed: 20 additions & 20 deletions

File tree

contrib/hamilton/contrib/dagworks/conversational_rag/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ result = dr.execute(
130130
)
131131
print(result)
132132
```
133-
MiniMax uses the [MiniMax-M2.7](https://www.minimax.io/) model with a 1M token context window
133+
MiniMax uses the [MiniMax-M3](https://www.minimax.io/) model with a 512K context context window
134134
via an OpenAI-compatible API endpoint.
135135

136136
# How to extend this module
@@ -150,7 +150,7 @@ With (3) you can add more functions that create parts of the prompt.
150150

151151
| Config Key | Values | Description |
152152
|-----------|--------|-------------|
153-
| `provider` | `"minimax"` | Use MiniMax M2.7 as the LLM. Requires `MINIMAX_API_KEY` env var. |
153+
| `provider` | `"minimax"` | Use MiniMax M3 as the LLM. Requires `MINIMAX_API_KEY` env var. |
154154
| *(empty)* | | Default: uses OpenAI. Requires `OPENAI_API_KEY` env var. |
155155

156156
# Limitations

contrib/hamilton/contrib/dagworks/conversational_rag/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def model__openai() -> str:
148148
@config.when(provider="minimax")
149149
def model__minimax() -> str:
150150
"""The model to use for MiniMax."""
151-
return "MiniMax-M2.7"
151+
return "MiniMax-M3"
152152

153153

154154
def conversational_rag_response(answer_prompt: str, llm_client: openai.OpenAI, model: str) -> str:

contrib/hamilton/contrib/dagworks/conversational_rag/test_conversational_rag.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ class TestModelConfig:
8080
def test_model_openai_returns_gpt35(self):
8181
assert conversational_rag.model__openai() == "gpt-3.5-turbo"
8282

83-
def test_model_minimax_returns_m27(self):
84-
assert conversational_rag.model__minimax() == "MiniMax-M2.7"
83+
def test_model_minimax_returns_m3(self):
84+
assert conversational_rag.model__minimax() == "MiniMax-M3"
8585

8686

8787
class TestOpenAIProvider:
@@ -153,11 +153,11 @@ def test_standalone_question_with_minimax_model(self):
153153
result = conversational_rag.standalone_question(
154154
standalone_question_prompt="test prompt",
155155
llm_client=mock_client,
156-
model="MiniMax-M2.7",
156+
model="MiniMax-M3",
157157
)
158158
assert result == "standalone question"
159159
call_args = mock_client.chat.completions.create.call_args
160-
assert call_args.kwargs["model"] == "MiniMax-M2.7"
160+
assert call_args.kwargs["model"] == "MiniMax-M3"
161161

162162
def test_rag_response_with_minimax_model(self):
163163
mock_client = MagicMock(spec=openai.OpenAI)
@@ -169,11 +169,11 @@ def test_rag_response_with_minimax_model(self):
169169
result = conversational_rag.conversational_rag_response(
170170
answer_prompt="Where did stefan work?",
171171
llm_client=mock_client,
172-
model="MiniMax-M2.7",
172+
model="MiniMax-M3",
173173
)
174174
assert result == "MiniMax answer"
175175
call_args = mock_client.chat.completions.create.call_args
176-
assert call_args.kwargs["model"] == "MiniMax-M2.7"
176+
assert call_args.kwargs["model"] == "MiniMax-M3"
177177

178178

179179
class TestHamiltonDriverConfig:
@@ -293,7 +293,7 @@ def test_minimax_standalone_question_real_api(self, minimax_api_key):
293293
"Follow Up Input: Where did he work?\n"
294294
"Standalone question:",
295295
llm_client=client,
296-
model="MiniMax-M2.7",
296+
model="MiniMax-M3",
297297
)
298298
assert isinstance(result, str)
299299
assert len(result) > 0
@@ -306,7 +306,7 @@ def test_minimax_conversational_rag_response_real_api(self, minimax_api_key):
306306
"Stefan worked at Stitch Fix.\n\n"
307307
"Question: Where did Stefan work?",
308308
llm_client=client,
309-
model="MiniMax-M2.7",
309+
model="MiniMax-M3",
310310
)
311311
assert isinstance(result, str)
312312
assert len(result) > 0

contrib/hamilton/contrib/dagworks/faiss_rag/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ result = dr.execute(
102102
)
103103
print(result)
104104
```
105-
MiniMax uses the [MiniMax-M2.7](https://www.minimax.io/) model with a 1M token context window
105+
MiniMax uses the [MiniMax-M3](https://www.minimax.io/) model with a 512K context context window
106106
via an OpenAI-compatible API endpoint.
107107

108108
# How to extend this module
@@ -122,7 +122,7 @@ With (3) you can add more functions that create parts of the prompt.
122122

123123
| Config Key | Values | Description |
124124
|-----------|--------|-------------|
125-
| `provider` | `"minimax"` | Use MiniMax M2.7 as the LLM. Requires `MINIMAX_API_KEY` env var. |
125+
| `provider` | `"minimax"` | Use MiniMax M3 as the LLM. Requires `MINIMAX_API_KEY` env var. |
126126
| *(empty)* | | Default: uses OpenAI. Requires `OPENAI_API_KEY` env var. |
127127

128128
# Limitations

contrib/hamilton/contrib/dagworks/faiss_rag/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def model__openai() -> str:
108108
@config.when(provider="minimax")
109109
def model__minimax() -> str:
110110
"""The model to use for MiniMax."""
111-
return "MiniMax-M2.7"
111+
return "MiniMax-M3"
112112

113113

114114
def rag_response(rag_prompt: str, llm_client: openai.OpenAI, model: str) -> str:

contrib/hamilton/contrib/dagworks/faiss_rag/test_faiss_rag.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ class TestModelConfig:
6565
def test_model_openai_returns_gpt35(self):
6666
assert faiss_rag.model__openai() == "gpt-3.5-turbo"
6767

68-
def test_model_minimax_returns_m27(self):
69-
assert faiss_rag.model__minimax() == "MiniMax-M2.7"
68+
def test_model_minimax_returns_m3(self):
69+
assert faiss_rag.model__minimax() == "MiniMax-M3"
7070

7171

7272
class TestOpenAIProvider:
@@ -116,7 +116,7 @@ def test_llm_client_minimax_uses_env_api_key(self):
116116
assert client.api_key == "my-secret-key"
117117

118118
def test_rag_response_with_minimax_model(self):
119-
"""Test that rag_response works with MiniMax-M2.7 model."""
119+
"""Test that rag_response works with MiniMax-M3 model."""
120120
mock_client = MagicMock(spec=openai.OpenAI)
121121
mock_response = MagicMock()
122122
mock_response.choices = [MagicMock()]
@@ -126,12 +126,12 @@ def test_rag_response_with_minimax_model(self):
126126
result = faiss_rag.rag_response(
127127
rag_prompt="Where did stefan work?",
128128
llm_client=mock_client,
129-
model="MiniMax-M2.7",
129+
model="MiniMax-M3",
130130
)
131131

132132
assert result == "Stitch Fix"
133133
mock_client.chat.completions.create.assert_called_once_with(
134-
model="MiniMax-M2.7",
134+
model="MiniMax-M3",
135135
messages=[{"role": "user", "content": "Where did stefan work?"}],
136136
)
137137

@@ -243,7 +243,7 @@ def test_minimax_rag_response_real_api(self, minimax_api_key):
243243
"Stefan worked at Stitch Fix.\n\n"
244244
"Question: Where did Stefan work?",
245245
llm_client=client,
246-
model="MiniMax-M2.7",
246+
model="MiniMax-M3",
247247
)
248248
assert isinstance(result, str)
249249
assert len(result) > 0

0 commit comments

Comments
 (0)