Langertha
view release on metacpan or search on metacpan
lib/Langertha/Engine/MiniMax.pm view on Meta::CPAN
use Langertha::Engine::MiniMax;
my $minimax = Langertha::Engine::MiniMax->new(
api_key => $ENV{MINIMAX_API_KEY},
model => 'MiniMax-M2.7',
);
print $minimax->simple_chat('Hello from Perl!');
# Streaming
$minimax->simple_chat_stream(sub {
print shift->content;
}, 'Write a poem');
# Tool calling
my $response = await $minimax->chat_with_tools_f('Search for Perl modules');
=head1 DESCRIPTION
Provides access to L<MiniMax|https://www.minimax.io/> models via their
native OpenAI-compatible endpoint at C<https://api.minimax.io/v1>.
MiniMax is a Chinese AI company based in Shanghai offering large language
models with strong coding, reasoning, and agentic capabilities.
B<Why the OpenAI endpoint, not the Anthropic one:> MiniMax also exposes an
C</anthropic> endpoint, but that endpoint is a shim â it does not always
re-parse stringified tool-call arguments, leading to intermittent tool-
calling failures where the Anthropic SDK sees a wrapper object whose key
rotates between C<result>, C<arguments>, and the tool name. The native
OpenAI-compatible endpoint avoids the shim entirely. If you need the
Anthropic wire format, use L<Langertha::Engine::MiniMaxAnthropic>.
B<Available text models:>
=over 4
=item * C<MiniMax-M2.7> â Latest flagship (default).
=item * C<MiniMax-M2.5> â 1M context window, SOTA coding (80.2%
SWE-Bench Verified), agentic tool use, and search.
=item * C<MiniMax-M2.5-highspeed> â Same M2.5 performance with lower
latency. 205K context window.
=item * C<MiniMax-M2.1> â 230B total parameters, 10B activated per
inference. Strong multilingual coding and reasoning.
=item * C<MiniMax-M2.1-highspeed> â Same M2.1 performance with lower
latency.
=item * C<MiniMax-M2> â 200K context, 128K max output. Function calling
and agentic capabilities.
=back
See L<https://platform.minimax.io/docs/guides/models-intro> for the full
model catalog including audio, video, and music models.
Supports chat, streaming, tool calling, and structured output. Embeddings,
transcription, images, and documents are not supported via this endpoint.
Get your API key at L<https://platform.minimax.io/> and set
C<LANGERTHA_MINIMAX_API_KEY> in your environment.
=head1 SEE ALSO
=over
=item * L<Langertha::Engine::MiniMaxAnthropic> - MiniMax via legacy Anthropic-compatible endpoint
=item * L<https://platform.minimax.io/docs/api-reference/text-openai-api> - MiniMax OpenAI-compatible API docs
=item * L<Langertha::Engine::OpenAIBase> - Base class for OpenAI-compatible engines
=item * L<Langertha::Role::Tools> - MCP tool calling interface
=back
=head1 SUPPORT
=head2 Issues
Please report bugs and feature requests on GitHub at
L<https://github.com/Getty/langertha/issues>.
=head2 IRC
Join C<#langertha> on C<irc.perl.org> or message Getty directly.
=head1 CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
=head1 AUTHOR
Torsten Raudssus <getty@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 1.072 second using v1.01-cache-2.11-cpan-0bb4e1dffa6 )