Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultOptions represent neutral parameters for interacting with LLaMA model. DefaultOptions = Options{ ModelPath: "", Seed: 0, Temp: 1, MinP: 0, } )
Functions ¶
func Serve ¶
Serve starts LLM server and returns error if it fails. It is the caller's responsibility to close Server.
func SetDefault ¶
SetDefault sets default Client and Server.
Types ¶
type Client ¶
type Client struct { // Addr specifies the address of the LLM server. // If empty, "localhost:24114" is used. Addr string // Options specifies options for underlying LLM server. // If nil, DefaultOptions are used. Options *Options // Logger specifies logger for the client. Logger *slog.Logger }
Client represents client for LLM server.
type CmdLogger ¶
type CmdLogger struct { // Log specifies an optional logger for exec.Cmd output // If nil, logging is done via the slog package's standard logger. Log *slog.Logger }
CmdLogger is a slog.Logger wrapper for exec.Cmd output.
type Server ¶
type Server struct { // Path specifies a path to LLM server executable. // If empty, "./llm-server" is used. Path string // Addr optionally specifies the TCP address for the server to listen on, // in the form "host:port". // If empty, "localhost:24114"is used. Addr string // Cmd specifies a command for underlying LLM server. // If nil, the default command is used: `./llm-server --ctx-size 2048`. Cmd *exec.Cmd // Logger specifies an optional logger for underlying server errors and // debug messages. // If nil, logging is done to stderr. Logger *slog.Logger }
Server represents LLM server.
Click to show internal directories.
Click to hide internal directories.