ggml-rpc.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "ggml-backend.h"
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #define RPC_PROTO_MAJOR_VERSION 3
  7. #define RPC_PROTO_MINOR_VERSION 6
  8. #define RPC_PROTO_PATCH_VERSION 0
  9. #define GGML_RPC_MAX_SERVERS 16
  10. // backend API
  11. GGML_BACKEND_API ggml_backend_t ggml_backend_rpc_init(const char * endpoint, uint32_t device);
  12. GGML_BACKEND_API bool ggml_backend_is_rpc(ggml_backend_t backend);
  13. GGML_BACKEND_API ggml_backend_buffer_type_t ggml_backend_rpc_buffer_type(const char * endpoint, uint32_t device);
  14. GGML_BACKEND_API void ggml_backend_rpc_get_device_memory(const char * endpoint, uint32_t device, size_t * free, size_t * total);
  15. GGML_BACKEND_API void ggml_backend_rpc_start_server(const char * endpoint, const char * cache_dir,
  16. size_t n_threads, size_t n_devices, ggml_backend_dev_t * devices);
  17. GGML_BACKEND_API ggml_backend_reg_t ggml_backend_rpc_reg(void);
  18. GGML_BACKEND_API ggml_backend_reg_t ggml_backend_rpc_add_server(const char * endpoint);
  19. #ifdef __cplusplus
  20. }
  21. #endif