llama-cpp-hs
Copyright(c) 2025 Tushar Adhatrao
LicenseMIT
MaintainerTushar Adhatrao <[email protected]>
Safe HaskellNone
LanguageHaskell2010

Llama.Context

Description

 
Synopsis

Documentation

supportsRpc :: IO Bool Source #

Check if the backend supports remote procedure calls (RPC).

supportsGpuOffload :: IO Bool Source #

Check if the backend supports GPU offloading.

supportsMLock :: IO Bool Source #

Check if the backend supports locking model memory into RAM (no swapping).

supportsMMap :: IO Bool Source #

Check if the backend supports memory mapping models.

getMaxDevices :: IO Int Source #

Get maximum number of devices supported by the backend (e.g., GPUs).

getTimeUs :: IO Int Source #

Get current time in microseconds since some unspecified epoch.

getContextSize :: Context -> IO Int Source #

Get the maximum context size (n_ctx) of the model in the given context.

getBatchSize :: Context -> IO Int Source #

Get the batch size (n_batch) used by the context.

getUnbatchedSize :: Context -> IO Int Source #

Get the unbatched size (n_ubatch).

getMaxSeqCount :: Context -> IO Int Source #

Get the maximum number of sequences supported.

getPoolingType :: Context -> IO (Maybe LlamaPoolingType) Source #

Get the pooling type used by the context.

detachThreadPool :: Context -> IO () Source #

Detach the internal threadpool from the context.

defaultContextParams :: IO LlamaContextParams Source #

Allocate and initialize a new LlamaContextParams with defaults.