Skip to content

LLamaKvCacheViewSafeHandle

Namespace: LLama.Native

A safe handle for a LLamaKvCacheView

1
public class LLamaKvCacheViewSafeHandle : SafeLLamaHandleBase, System.IDisposable

Inheritance ObjectCriticalFinalizerObjectSafeHandleSafeLLamaHandleBaseLLamaKvCacheViewSafeHandle
Implements IDisposable

Properties

IsInvalid

1
public bool IsInvalid { get; }

Property Value

Boolean

IsClosed

1
public bool IsClosed { get; }

Property Value

Boolean

Constructors

LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle, LLamaKvCacheView)

Initialize a LLamaKvCacheViewSafeHandle which will call llama_kv_cache_view_free when disposed

1
public LLamaKvCacheViewSafeHandle(SafeLLamaContextHandle ctx, LLamaKvCacheView view)

Parameters

ctx SafeLLamaContextHandle

view LLamaKvCacheView

Methods

Allocate(SafeLLamaContextHandle, Int32)

Allocate a new KV cache view which can be used to inspect the KV cache

1
public static LLamaKvCacheViewSafeHandle Allocate(SafeLLamaContextHandle ctx, int maxSequences)

Parameters

ctx SafeLLamaContextHandle

maxSequences Int32
The maximum number of sequences visible in this view per cell

Returns

LLamaKvCacheViewSafeHandle

ReleaseHandle()

1
protected bool ReleaseHandle()

Returns

Boolean

Update()

Update this view

1
public void Update()

GetView()

Get the raw KV cache view

1
public LLamaKvCacheView& GetView()

Returns

LLamaKvCacheView&