# LLamaModelV1
Namespace: LLama
#### Caution
This type is obsolete.
---
```csharp
public class LLamaModelV1
```
Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [LLamaModelV1](./llama.llamamodelv1.md)
## Constructors
### **LLamaModelV1(String, Int32, Int32, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, Boolean, Int32, Int32, Int32, String, String, Boolean)**
```csharp
public LLamaModelV1(string model_path, int n_ctx, int n_parts, int seed, bool f16_kv, bool logits_all, bool vocab_only, bool use_mmap, bool use_mlock, bool embedding, int n_threads, int n_batch, int last_n_tokens_size, string lora_base, string lora_path, bool verbose)
```
#### Parameters
`model_path` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`n_ctx` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`n_parts` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`seed` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`f16_kv` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`logits_all` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`vocab_only` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`use_mmap` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`use_mlock` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`embedding` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`n_threads` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`n_batch` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`last_n_tokens_size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`lora_base` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`lora_path` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`verbose` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
### **LLamaModelV1(LLamaModelV1)**
```csharp
public LLamaModelV1(LLamaModelV1 other)
```
#### Parameters
`other` [LLamaModelV1](./llama.llamamodelv1.md)
## Methods
### **Tokenize(String)**
```csharp
public List Tokenize(string text)
```
#### Parameters
`text` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
#### Returns
[List<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)
### **DeTokenize(IEnumerable<Int32>)**
```csharp
public string DeTokenize(IEnumerable tokens)
```
#### Parameters
`tokens` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
#### Returns
[String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
### **DeTokenize(Int32)**
```csharp
public string DeTokenize(int token)
```
#### Parameters
`token` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
#### Returns
[String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
### **SetCache(LLamaCache)**
```csharp
public void SetCache(LLamaCache cache)
```
#### Parameters
`cache` [LLamaCache](./llama.llamacache.md)
### **Reset()**
```csharp
public void Reset()
```
### **Eval(List<Int32>)**
```csharp
public void Eval(List tokens)
```
#### Parameters
`tokens` [List<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1)
### **Sample(Int32, Single, Single, Single, Single, Single)**
```csharp
public int Sample(int top_k, float top_p, float temp, float repeat_penalty, float frequency_penalty, float presence_penalty)
```
#### Parameters
`top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`temp` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
#### Returns
[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
### **Generate(IEnumerable<Int32>, Int32, Single, Single, Single, Single, Single, Boolean)**
```csharp
public IEnumerable Generate(IEnumerable tokens, int top_k, float top_p, float temp, float repeat_penalty, float frequency_penalty, float presence_penalty, bool reset)
```
#### Parameters
`tokens` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
`top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`temp` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`reset` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
#### Returns
[IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
### **CreateEmbedding(String)**
```csharp
public Embedding CreateEmbedding(string input)
```
#### Parameters
`input` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
#### Returns
[Embedding](./llama.types.embedding.md)
### **Embed(String)**
```csharp
public Single[] Embed(string input)
```
#### Parameters
`input` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
#### Returns
[Single[]](https://docs.microsoft.com/en-us/dotnet/api/system.single)
### **CreateCompletion(String, String, Int32, Single, Single, Int32, Boolean, String[], Single, Single, Single, Int32)**
```csharp
public IEnumerable CreateCompletion(string prompt, string suffix, int max_tokens, float temperature, float top_p, int logprobs, bool echo, String[] stop, float frequency_penalty, float presence_penalty, float repeat_penalty, int top_k)
```
#### Parameters
`prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`suffix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`logprobs` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`echo` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
#### Returns
[IEnumerable<CompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
### **Call(String, String, Int32, Single, Single, Int32, Boolean, String[], Single, Single, Single, Int32)**
```csharp
public IEnumerable Call(string prompt, string suffix, int max_tokens, float temperature, float top_p, int logprobs, bool echo, String[] stop, float frequency_penalty, float presence_penalty, float repeat_penalty, int top_k)
```
#### Parameters
`prompt` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`suffix` [String](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`logprobs` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`echo` [Boolean](https://docs.microsoft.com/en-us/dotnet/api/system.boolean)
`stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
#### Returns
[IEnumerable<CompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
### **CreateChatCompletion(IEnumerable<ChatCompletionMessage>, Single, Single, Int32, String[], Int32, Single, Single, Single)**
```csharp
public IEnumerable CreateChatCompletion(IEnumerable messages, float temperature, float top_p, int top_k, String[] stop, int max_tokens, float presence_penalty, float frequency_penalty, float repeat_penalty)
```
#### Parameters
`messages` [IEnumerable<ChatCompletionMessage>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
`temperature` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_p` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`top_k` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`stop` [String[]](https://docs.microsoft.com/en-us/dotnet/api/system.string)
`max_tokens` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
`presence_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`frequency_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
`repeat_penalty` [Single](https://docs.microsoft.com/en-us/dotnet/api/system.single)
#### Returns
[IEnumerable<ChatCompletionChunk>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
### **SaveState()**
```csharp
public LLamaState SaveState()
```
#### Returns
[LLamaState](./llama.llamastate.md)
### **LoadState(LLamaState)**
```csharp
public void LoadState(LLamaState state)
```
#### Parameters
`state` [LLamaState](./llama.llamastate.md)
### **LongestTokenPrefix(IEnumerable<Int32>, IEnumerable<Int32>)**
```csharp
internal static int LongestTokenPrefix(IEnumerable a, IEnumerable b)
```
#### Parameters
`a` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
`b` [IEnumerable<Int32>](https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.ienumerable-1)
#### Returns
[Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)
### **<CreateChatCompletion>g__GetRole|31_0(ChatCompletionMessage)**
```csharp
internal static string g__GetRole|31_0(ChatCompletionMessage message)
```
#### Parameters
`message` [ChatCompletionMessage](./llama.types.chatcompletionmessage.md)
#### Returns
[String](https://docs.microsoft.com/en-us/dotnet/api/system.string)