Skip to content

Add MiniMax RAG cookbook notebook#280

Open
octo-patch wants to merge 1 commit intodeepset-ai:mainfrom
octo-patch:feature/add-minimax-cookbook
Open

Add MiniMax RAG cookbook notebook#280
octo-patch wants to merge 1 commit intodeepset-ai:mainfrom
octo-patch:feature/add-minimax-cookbook

Conversation

@octo-patch
Copy link
Copy Markdown

Summary

Add a new cookbook notebook demonstrating how to use MiniMax large language models with Haystack via the OpenAI-compatible API.

What's included

  • notebooks/rag_with_minimax.ipynb — Cookbook notebook covering:
    • Basic chat with MiniMax using OpenAIChatGenerator
    • Full RAG pipeline with InMemoryDocumentStore, sentence-transformer embeddings, and MiniMax as the generator
    • Model comparison between MiniMax-M2.7 (204K context) and MiniMax-M2.7-highspeed (speed-optimized)
  • index.toml — Added entry for the new notebook
  • tests/test_rag_with_minimax.py — 34 tests (31 unit + 3 integration)

Why MiniMax?

MiniMax provides models with a 204K context window accessible via an OpenAI-compatible API (https://api.minimax.io/v1). This means no extra integration packages are needed — Haystack's built-in OpenAIChatGenerator works out of the box by setting api_base_url.

Key configuration

from haystack.components.generators.chat import OpenAIChatGenerator
from haystack.utils import Secret

generator = OpenAIChatGenerator(
    api_key=Secret.from_env_var("MINIMAX_API_KEY"),
    model="MiniMax-M2.7",
    api_base_url="https://api.minimax.io/v1",
)

Test plan

  • 31 unit tests pass (notebook structure, config validation, index.toml)
  • 3 integration tests pass (MiniMax API chat completion, Haystack generator)
  • scripts/verify_index.py passes

Add a new cookbook notebook demonstrating how to use MiniMax M2.7 and
M2.7-highspeed models with Haystack via the OpenAI-compatible API.

The notebook covers:
- Basic chat with MiniMax using OpenAIChatGenerator
- Full RAG pipeline with InMemoryDocumentStore and embedding retrieval
- Model comparison between M2.7 and M2.7-highspeed variants

Also includes 34 tests (31 unit + 3 integration) validating notebook
structure, MiniMax configuration, and API connectivity.
@octo-patch octo-patch requested a review from a team as a code owner April 1, 2026 08:40
@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Copy Markdown
Contributor

@bilgeyucel bilgeyucel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @octo-patch, thanks for the PR! I see that you use this notebook to showcase how to use MiniMax models with Haystack. Instead of adding a new cookbook, would you like to add a new integration page to haystack-integrations with the code examples and information you have? I see that we are missing that.
Let me know if you have any questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants