llamacpp_rpc_client 0.2.0 copy "llamacpp_rpc_client: ^0.2.0" to clipboard
llamacpp_rpc_client: ^0.2.0 copied to clipboard

HTTP client bindings to call the llama.cpp RPC server

example/example.dart

import 'package:llamacpp_rpc_client/llamacpp_rpc_client.dart';

void main() async {
  final client = LlamacppRpcClient('http://localhost:8080');

  // Text completion
  final completion = await client.completion(
    'The capital of France is',
    options: CompletionOptions(maxTokens: 50, temperature: 0.7),
  );
  print(completion.content);

  // Streaming completion
  await for (final chunk in client.streamCompletion('Tell me a story')) {
    print(chunk.content);
  }

  // Text embedding
  final embedding = await client.embedding('Hello world');
  print(embedding.embedding.length);

  client.close();
}
0
likes
160
points
150
downloads

Publisher

verified publisheragilord.com

Weekly Downloads

HTTP client bindings to call the llama.cpp RPC server

Repository (GitHub)
View/report issues

Topics

#llamacpp #llama-cpp #rpc #llm #client

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

args, executor, http, json_annotation

More

Packages that depend on llamacpp_rpc_client