Langertha/Engine/SGLang.pm

filter: Statementstmt 100% 11 / 11 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod 100% 1 / 1 totaltotal 100% 15 / 15 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
default_model
1.0
_build_supported_operations
1.0
CRAP 1.0
« Langertha/Engine/OpenAIBase.pm ↑ Summary Langertha/Engine/vLLM.pm »
1 package Langertha::Engine::SGLang;
2 # ABSTRACT: SGLang inference server
3 2 our $VERSION = '0.502';
4 2 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 extends 'Langertha::Engine::OpenAIBase';
7  
8 2 with 'Langertha::Role::Tools';
9  
10  
11 2 has '+url' => (
12 required => 1,
13 );
14  
15 1 ▶sub default_model { 'default' }
Subroutine default_model: called CC=1 SCAR=0.0
Pod documented
16  
17 1 ▶sub _build_supported_operations {[qw(
Subroutine _build_supported_operations: called CC=1 SCAR=0.0
18 createChatCompletion
19 createCompletion
20 )]}
21  
22 2 __PACKAGE__->meta->make_immutable;
23  
24  
25 2 1;
26  
27 __END__
28  
29 =pod
30  
31 =encoding UTF-8
32  
33 =head1 NAME
34  
35 Langertha::Engine::SGLang - SGLang inference server
36  
37 =head1 VERSION
38  
39 version 0.502
40  
41 =head1 SYNOPSIS
42  
43 use Langertha::Engine::SGLang;
44  
45 my $sglang = Langertha::Engine::SGLang->new(
46 url => 'http://localhost:30000/v1',
47 model => 'Qwen/Qwen2.5-7B-Instruct',
48 );
49  
50 print $sglang->simple_chat('Say something nice');
51  
52 =head1 DESCRIPTION
53  
54 Adapter for SGLang's OpenAI-compatible endpoint.
55 SGLang is typically exposed as C</v1/chat/completions> with optional
56 tool-calling support depending on model/backend setup.
57  
58 Only C<url> is required. Use the full C</v1> base URL.
59 No API key is required for local setups.
60  
61 B<THIS API IS WORK IN PROGRESS>
62  
63 =head1 SEE ALSO
64  
65 =over
66  
67 =item * L<https://docs.sglang.ai/> - SGLang documentation
68  
69 =item * L<Langertha::Engine::OpenAIBase> - Base class for OpenAI-compatible engines
70  
71 =item * L<Langertha::Role::Tools> - MCP tool calling interface
72  
73 =item * L<Langertha::Engine::vLLM> - Similar self-hosted OpenAI-compatible engine
74  
75 =back
76  
77 =head1 SUPPORT
78  
79 =head2 Issues
80  
81 Please report bugs and feature requests on GitHub at
82 L<https://github.com/Getty/langertha/issues>.
83  
84 =head2 IRC
85  
86 Join C<#langertha> on C<irc.perl.org> or message Getty directly.
87  
88 =head1 CONTRIBUTING
89  
90 Contributions are welcome! Please fork the repository and submit a pull request.
91  
92 =head1 AUTHOR
93  
94 Torsten Raudssus <getty@cpan.org>
95  
96 =head1 COPYRIGHT AND LICENSE
97  
98 This software is copyright (c) 2026 by Torsten Raudssus L<https://raudssus.de/>.
99  
100 This is free software; you can redistribute it and/or modify it under
101 the same terms as the Perl 5 programming language system itself.
102  
103 =cut
« Langertha/Engine/OpenAIBase.pm ↑ Summary Langertha/Engine/vLLM.pm »