-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathOllama.cs
50 lines (46 loc) · 1.41 KB
/
Ollama.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Runtime.Serialization;
using ServiceStack;
namespace AiServer.ServiceModel;
[Tag(Tags.AiInfo)]
public class GetOllamaModels : IGet, IReturn<GetOllamaModelsResponse>
{
[ValidateNotEmpty]
public string ApiBaseUrl { get; set; }
}
public class GetOllamaModelsResponse
{
public List<OllamaModel> Results { get; set; }
public ResponseStatus ResponseStatus { get; set; }
}
[DataContract]
public class OllamaModel
{
[DataMember(Name = "name")]
public string Name { get; set; }
[DataMember(Name = "model")]
public string Model { get; set; }
[DataMember(Name = "modified_at")]
public DateTime ModifiedAt { get; set; }
[DataMember(Name = "size")]
public long Size { get; set; }
[DataMember(Name = "digest")]
public string Digest { get; set; }
[DataMember(Name = "details")]
public OllamaModelDetails Details { get; set; }
}
[DataContract]
public class OllamaModelDetails
{
[DataMember(Name = "parent_model")]
public string ParentModel { get; set; }
[DataMember(Name = "format")]
public string Format { get; set; }
[DataMember(Name = "family")]
public string Family { get; set; }
[DataMember(Name = "families")]
public List<string> Families { get; set; }
[DataMember(Name = "parameter_size")]
public string ParameterSize { get; set; }
[DataMember(Name = "quantization_level")]
public string QuantizationLevel { get; set; }
}