feat: add MiniMax as configurable LLM provider for summarization and code interpreter#106
Open
octo-patch wants to merge 1 commit into
Open
feat: add MiniMax as configurable LLM provider for summarization and code interpreter#106octo-patch wants to merge 1 commit into
octo-patch wants to merge 1 commit into
Conversation
…code interpreter - utils/summarise.py: support LLM_PROVIDER=minimax via OpenAI-compat client pointing to https://api.minimax.io/v1, using MiniMax-M2.7 (204K context) - service/code_interpreter.py: same provider selection; temperature clamped to 0.01 for MiniMax (API requires temperature > 0) - .env.example: document LLM_PROVIDER and MINIMAX_API_KEY env vars - README.md: add LLM providers table with MiniMax row - tests/: 17 unit tests + 2 integration tests (pytest-asyncio)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LLM_PROVIDERenv var (openaiorminimax)utils/summarise.py: whenLLM_PROVIDER=minimax, usesAsyncOpenAIpointed athttps://api.minimax.io/v1with modelMiniMax-M2.7(204K context window)service/code_interpreter.py: same provider routing; temperature is clamped to0.01for MiniMax because the API requires temperature > 0.env.example: documents the two new env vars (LLM_PROVIDER,MINIMAX_API_KEY)README.md: adds a "LLM providers" table listing OpenAI (default) and MiniMaxtests/: 17 unit tests (fully mocked) + 2 integration tests against the real MiniMax APITest plan
platform linux -- Python 3.10.12, pytest-8.2.0, pluggy-1.6.0
codspeed: 4.3.0 (disabled, mode: walltime, callgraph: not supported, timer_resolution: 1.0ns)
benchmark: 5.2.3 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/ximi/github_pr/automation/repos/super-rag
configfile: pyproject.toml
plugins: logfire-4.29.0, flaky-3.8.1, syrupy-5.1.0, recording-0.13.4, anyio-4.13.0, order-1.3.0, examples-0.0.18, mock-3.15.1, timeout-2.4.0, asyncio-0.23.6, respx-0.22.0, cov-4.1.0, hydra-core-1.3.2, benchmark-5.2.3, typeguard-4.5.1, codspeed-4.3.0, langsmith-0.7.22, dotenv-0.5.2, socket-0.7.0, requests-mock-1.12.1, Faker-37.12.0, httpx-0.36.0, xdist-3.8.0
asyncio: mode=strict
collected 19 items / 2 deselected / 17 selected
tests/test_minimax_provider.py ................. [100%]
=============================== warnings summary ===============================
tests/test_minimax_provider.py:270
/home/ximi/github_pr/automation/repos/super-rag/tests/test_minimax_provider.py:270: PytestUnknownMarkWarning: Unknown pytest.mark.integration - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
@pytest.mark.integration
tests/test_minimax_provider.py::TestGenerateContent::test_contains_document_content
/home/ximi/github_pr/automation/repos/super-rag/models/document.py:72: PydanticDeprecatedSince20: Pydantic V1 style
@validatorvalidators are deprecated. You should migrate to Pydantic V2 style@field_validatorvalidators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/@validator("id")
tests/test_minimax_provider.py::TestGenerateContent::test_contains_document_content
/home/ximi/github_pr/automation/repos/super-rag/models/document.py:80: PydanticDeprecatedSince20: Pydantic V1 style
@validatorvalidators are deprecated. You should migrate to Pydantic V2 style@field_validatorvalidators, see the migration guide for more details. Deprecated in Pydantic V2.0 to be removed in V3.0. See Pydantic V2 Migration Guide at https://errors.pydantic.dev/2.12/migration/@validator("dense_embedding")
tests/test_minimax_provider.py::TestCompletion::test_completion_openai
/home/ximi/.local/lib/python3.10/site-packages/pytest_asyncio/plugin.py:759: DeprecationWarning: The event_loop fixture provided by pytest-asyncio has been redefined in
/home/ximi/github_pr/automation/repos/super-rag/tests/conftest.py:7
Replacing the event_loop fixture with a custom implementation is deprecated
and will lead to errors in the future.
If you want to request an asyncio event loop with a scope other than function
scope, use the "scope" argument to the asyncio mark when marking the tests.
If you want to return different types of event loops, use the event_loop_policy
fixture.
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================ 17 passed, 2 deselected, 4 warnings in 50.00s ================= — 17 passed
LLM_PROVIDERis unset (defaults to OpenAI)LLM_PROVIDER=minimax+MINIMAX_API_KEYin.env, run the ingest → query pipeline and verify summaries are generated via MiniMax