lib_llama_cpp_server 0.7.1 copy "lib_llama_cpp_server: ^0.7.1" to clipboard
lib_llama_cpp_server: ^0.7.1 copied to clipboard

Local OpenAI-compatible HTTP server for lib_llama_cpp.

lib_llama_cpp_server #

pub package

Pure Dart local HTTP server for lib_llama_cpp.

This package provides a small OpenAI-compatible server around the persistent llcs_engine binding. It exposes health, model listing, and chat completion routes for local clients that want to talk to a GGUF model through HTTP while keeping the model loaded in process.

Flutter apps should normally depend on lib_llama_cpp, which re-exports this server API. Server mode is the recommended local-model integration path for long-lived application sessions.

import 'package:lib_llama_cpp/lib_llama_cpp.dart';

final server = LlamaHttpServer.open(
  config: LlamaServerConfig(
    model: 'local',
    modelPath: '/models/model.gguf',
    port: 0,
  ),
);
final address = await server.start();

final client = LlamaServerClient(
  baseUri: Uri.parse('http://${address.host}:${address.port}/v1'),
);
dart run lib_llama_cpp_server \
  --library /path/to/liblib_llama_cpp_linux.so \
  --model local \
  --model-path /models/model.gguf \
  --host 127.0.0.1 \
  --port 8080

Supported first-pass endpoints:

  • GET /healthz
  • GET /v1/models
  • POST /v1/chat/completions

Streaming chat completions are returned as OpenAI-style server-sent events.

This package is model inference only. It does not expose local filesystem, shell, agent orchestration, or tool execution capabilities.

0
likes
0
points
306
downloads

Publisher

verified publishergsmlg.dev

Weekly Downloads

Local OpenAI-compatible HTTP server for lib_llama_cpp.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, lib_llama_cpp_ffi

More

Packages that depend on lib_llama_cpp_server