You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.native.llamacontextparams.md 3.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. # LLamaContextParams
  2. Namespace: LLama.Native
  3. A C# representation of the llama.cpp `llama_context_params` struct
  4. ```csharp
  5. public struct LLamaContextParams
  6. ```
  7. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [ValueType](https://docs.microsoft.com/en-us/dotnet/api/system.valuetype) → [LLamaContextParams](./llama.native.llamacontextparams.md)
  8. ## Fields
  9. ### **seed**
  10. RNG seed, -1 for random
  11. ```csharp
  12. public int seed;
  13. ```
  14. ### **n_ctx**
  15. text context
  16. ```csharp
  17. public int n_ctx;
  18. ```
  19. ### **n_batch**
  20. prompt processing batch size
  21. ```csharp
  22. public int n_batch;
  23. ```
  24. ### **n_gpu_layers**
  25. number of layers to store in VRAM
  26. ```csharp
  27. public int n_gpu_layers;
  28. ```
  29. ### **main_gpu**
  30. the GPU that is used for scratch and small tensors
  31. ```csharp
  32. public int main_gpu;
  33. ```
  34. ### **tensor_split**
  35. how to split layers across multiple GPUs
  36. ```csharp
  37. public IntPtr tensor_split;
  38. ```
  39. ### **rope_freq_base**
  40. ref: https://github.com/ggerganov/llama.cpp/pull/2054
  41. RoPE base frequency
  42. ```csharp
  43. public float rope_freq_base;
  44. ```
  45. ### **rope_freq_scale**
  46. ref: https://github.com/ggerganov/llama.cpp/pull/2054
  47. RoPE frequency scaling factor
  48. ```csharp
  49. public float rope_freq_scale;
  50. ```
  51. ### **progress_callback**
  52. called with a progress value between 0 and 1, pass NULL to disable
  53. ```csharp
  54. public IntPtr progress_callback;
  55. ```
  56. ### **progress_callback_user_data**
  57. context pointer passed to the progress callback
  58. ```csharp
  59. public IntPtr progress_callback_user_data;
  60. ```
  61. ## Properties
  62. ### **low_vram**
  63. if true, reduce VRAM usage at the cost of performance
  64. ```csharp
  65. public bool low_vram { get; set; }
  66. ```
  67. #### Property Value
  68. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  69. ### **mul_mat_q**
  70. if true, use experimental mul_mat_q kernels
  71. ```csharp
  72. public bool mul_mat_q { get; set; }
  73. ```
  74. #### Property Value
  75. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  76. ### **f16_kv**
  77. use fp16 for KV cache
  78. ```csharp
  79. public bool f16_kv { get; set; }
  80. ```
  81. #### Property Value
  82. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  83. ### **logits_all**
  84. the llama_eval() call computes all logits, not just the last one
  85. ```csharp
  86. public bool logits_all { get; set; }
  87. ```
  88. #### Property Value
  89. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  90. ### **vocab_only**
  91. only load the vocabulary, no weights
  92. ```csharp
  93. public bool vocab_only { get; set; }
  94. ```
  95. #### Property Value
  96. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  97. ### **use_mmap**
  98. use mmap if possible
  99. ```csharp
  100. public bool use_mmap { get; set; }
  101. ```
  102. #### Property Value
  103. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  104. ### **use_mlock**
  105. force system to keep model in RAM
  106. ```csharp
  107. public bool use_mlock { get; set; }
  108. ```
  109. #### Property Value
  110. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>
  111. ### **embedding**
  112. embedding mode only
  113. ```csharp
  114. public bool embedding { get; set; }
  115. ```
  116. #### Property Value
  117. [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)<br>