llama-cpp-bindings-sys 0.15.0

Low level bindings to llama.cpp
Documentation
#pragma once

#include "llama.cpp/ggml/include/ggml.h"
#include "llama.cpp/include/llama.h"

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum llama_rs_fit_params_status {
    LLAMA_RS_FIT_PARAMS_OK = 0,
    LLAMA_RS_FIT_PARAMS_NULL_PATH_MODEL_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_MPARAMS_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_CPARAMS_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_OUT_UNRECOGNIZED_STATUS_CODE_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_OUT_ERROR_ARG,
    LLAMA_RS_FIT_PARAMS_LLAMA_CPP_REPORTED_FAILURE,
    LLAMA_RS_FIT_PARAMS_LLAMA_CPP_REPORTED_ERROR,
    LLAMA_RS_FIT_PARAMS_LLAMA_CPP_RETURNED_UNRECOGNIZED_STATUS_CODE,
    LLAMA_RS_FIT_PARAMS_ERROR_STRING_ALLOCATION_FAILED,
    LLAMA_RS_FIT_PARAMS_LLAMA_CPP_OUT_OF_MEMORY,
    LLAMA_RS_FIT_PARAMS_LLAMA_CPP_THREW_CXX_EXCEPTION,
    LLAMA_RS_FIT_PARAMS_NULL_EXTRA_PATH_MODEL_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_EXTRA_MPARAMS_ARG,
    LLAMA_RS_FIT_PARAMS_NULL_EXTRA_CPARAMS_ARG,
} llama_rs_fit_params_status;

typedef struct llama_rs_fit_extra_model {
    const char * path_model;
    struct llama_model_params * mparams;
    struct llama_context_params * cparams;
    bool shares_model;
} llama_rs_fit_extra_model;

llama_rs_fit_params_status llama_rs_fit_params(
    const char * path_model,
    struct llama_model_params * mparams,
    struct llama_context_params * cparams,
    float * tensor_split,
    struct llama_model_tensor_buft_override * tensor_buft_overrides,
    size_t * margins,
    uint32_t n_ctx_min,
    const llama_rs_fit_extra_model * extra,
    enum ggml_log_level log_level,
    int32_t * out_unrecognized_status_code,
    char ** out_error);

#ifdef __cplusplus
}
#endif