pub struct RpcServer { /* private fields */ }Expand description
RPC server for hosting a backend that can be accessed remotely
Implementations§
Source§impl RpcServer
impl RpcServer
Sourcepub fn start(
backend: NonNull<ggml_backend>,
endpoint: &str,
free_mem: usize,
total_mem: usize,
) -> Result<Self, RpcError>
pub fn start( backend: NonNull<ggml_backend>, endpoint: &str, free_mem: usize, total_mem: usize, ) -> Result<Self, RpcError>
Start an RPC server for the given backend
§Arguments
backend- The backend to expose via RPCendpoint- The endpoint to listen on (e.g., “0.0.0.0:50052”)free_mem- Amount of free memory to advertise (0 for auto)total_mem- Total memory to advertise (0 for auto)
§Example
use llama_cpp_4::rpc::RpcServer;
// Assuming you have a backend initialized
let server = RpcServer::start(
backend,
"0.0.0.0:50052",
0,
0,
)?;Sourcepub fn backend(&self) -> NonNull<ggml_backend>
pub fn backend(&self) -> NonNull<ggml_backend>
Get the backend this server is hosting
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RpcServer
impl RefUnwindSafe for RpcServer
impl Unpin for RpcServer
impl UnsafeUnpin for RpcServer
impl UnwindSafe for RpcServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more