Documentation ¶
Index ¶
- Constants
- func CheckVRAM() (int64, error)
- func NumGPU(numLayer, fileSizeBytes int64, opts api.Options) int
- type DetokenizeRequest
- type DetokenizeResponse
- type EmbeddingRequest
- type EmbeddingResponse
- type GGML
- type LLM
- type ModelRunner
- type Running
- type StatusWriter
- type TokenizeRequest
- type TokenizeResponse
Constants ¶
View Source
const ( // Magic constant for `ggml` files (unversioned). FILE_MAGIC_GGML = 0x67676d6c // Magic constant for `ggml` files (versioned, ggmf). FILE_MAGIC_GGMF = 0x67676d66 // Magic constant for `ggml` files (versioned, ggjt). FILE_MAGIC_GGJT = 0x67676a74 // Magic constant for `ggla` files (LoRA adapter). FILE_MAGIC_GGLA = 0x67676C61 // Magic constant for `gguf` files (versioned, gguf) FILE_MAGIC_GGUF_LE = 0x46554747 FILE_MAGIC_GGUF_BE = 0x47475546 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DetokenizeRequest ¶
type DetokenizeRequest struct {
Tokens []int `json:"tokens"`
}
type DetokenizeResponse ¶
type DetokenizeResponse struct {
Content string `json:"content"`
}
type EmbeddingRequest ¶
type EmbeddingRequest struct {
Content string `json:"content"`
}
type EmbeddingResponse ¶
type EmbeddingResponse struct {
Embedding []float64 `json:"embedding"`
}
type GGML ¶
type GGML struct {
// contains filtered or unexported fields
}
func DecodeGGML ¶
func DecodeGGML(r io.ReadSeeker) (*GGML, error)
type LLM ¶
type LLM interface { Predict(context.Context, []int, string, func(api.GenerateResponse)) error Embedding(context.Context, string) ([]float64, error) Encode(context.Context, string) ([]int, error) Decode(context.Context, []int) (string, error) SetOptions(api.Options) Close() Ping(context.Context) error }
type ModelRunner ¶
type Running ¶
type Running struct { Port int Cmd *exec.Cmd Cancel context.CancelFunc *StatusWriter // captures error messages from the llama runner process // contains filtered or unexported fields }
type StatusWriter ¶
StatusWriter is a writer that captures error messages from the llama runner process
func NewStatusWriter ¶
func NewStatusWriter() *StatusWriter
type TokenizeRequest ¶
type TokenizeRequest struct {
Content string `json:"content"`
}
type TokenizeResponse ¶
type TokenizeResponse struct {
Tokens []int `json:"tokens"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.