NAME

Langertha::Engine::LMStudioAnthropic - LM Studio via Anthropic-compatible API

VERSION

version 0.503

SYNOPSIS

use Langertha::Engine::LMStudioAnthropic;

my $lm_anthropic = Langertha::Engine::LMStudioAnthropic->new(
    url   => 'http://localhost:1234',
    model => 'qwen2.5-7b-instruct-1m',
);

print $lm_anthropic->simple_chat('Hello from Anthropic-compatible endpoint');

DESCRIPTION

Adapter for LM Studio's Anthropic-compatible local endpoint (POST /v1/messages on the LM Studio server URL, default http://localhost:1234).

LM Studio requires a non-empty x-api-key header for this endpoint, but the value is not validated against Anthropic. This class defaults to lmstudio when no API key is configured.

A tool result that carries an embedded text resource or PDF goes out as plain text (the PDF as a placeholder): LM Studio documents no document or search_result block inside a tool_result, and its bug tracker reports PDFs rejected with a 400. This is conservative and not live-verified.

THIS API IS WORK IN PROGRESS

api_key

API key sent as x-api-key to the Anthropic-compatible endpoint. LM Studio accepts arbitrary non-empty values. Defaults to lmstudio when no explicit api_key and no LANGERTHA_LMSTUDIO_API_KEY are set.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/langertha/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus 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.