NAME

Langertha::Engine::Replicate - Replicate API

VERSION

version 0.302

SYNOPSIS

use Langertha::Engine::Replicate;

my $replicate = Langertha::Engine::Replicate->new(
    api_key => $ENV{REPLICATE_API_TOKEN},
    model   => 'meta/llama-4-maverick',
);

print $replicate->simple_chat('Hello from Perl!');

# Streaming
$replicate->simple_chat_stream(sub {
    print shift->content;
}, 'Write a Perl haiku');

DESCRIPTION

Provides access to Replicate's OpenAI-compatible chat endpoint. Replicate hosts thousands of open-source models with pay-per-use pricing.

Model names use owner/model format (e.g., meta/llama-4-maverick, meta/llama-4-scout). No default model is set; model must be specified explicitly.

Supports chat, streaming, and MCP tool calling via the OpenAI-compatible endpoint at https://api.replicate.com/v1. Embeddings and transcription are not supported through this interface.

Get your API token at https://replicate.com/account/api-tokens and set LANGERTHA_REPLICATE_API_KEY in your environment.

THIS API IS WORK IN PROGRESS

SEE ALSO

SUPPORT

Issues

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

CONTRIBUTING

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

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudss.us/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.