Repository navigation
Expand file tree
/
Copy pathLlmTestServerConfiguration.cs
More file actions
116 lines (86 loc) · 4.25 KB
/
Copy pathLlmTestServerConfiguration.cs
File metadata and controls
116 lines (86 loc) · 4.25 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
using ManagedCode.LlmTestServer.Models;
using ManagedCode.LlmTestServer.Runtime;
using ManagedCode.LlmTestServer.Scenarios;
namespace ManagedCode.LlmTestServer.Configuration;
public sealed record LlmTestServerConfiguration
{
public ManagedCode.LlmTestServer.Determinism.LlmTestServerDeterminism? Determinism { get; init; }
/// <summary>Maximum retained prompt-cache prefixes. Zero disables prompt caching.</summary>
public int MaxConversations { get; init; } = 256;
public long MaxConversationBytes { get; init; } = 16 * 1024 * 1024;
public int MaxPromptCacheEntries { get; init; } = 4096;
/// <summary>Maximum stored video jobs across providers. Zero rejects all new jobs.</summary>
public int MaxVideoJobs { get; init; } = 256;
/// <summary>Maximum total retained video payload bytes. Overflow is rejected without eviction.</summary>
public long MaxVideoBytes { get; init; } = 64 * 1024 * 1024;
/// <summary>Maximum stored chat responses. Zero disables response storage.</summary>
public int MaxStoredChatResponses { get; init; } = 256;
/// <summary>Maximum total retained chat-history bytes including bounded record overhead.</summary>
public long MaxStoredChatResponseBytes { get; init; } = 16 * 1024 * 1024;
public List<LlmTestServerModel> Models { get; init; } = [];
public List<ManagedCode.LlmTestServer.Decisions.LlmTestServerDecisionScenario> DecisionScenarios { get; init; } = [];
public List<LlmTestServerScenario> ChatScenarios { get; init; } = [];
public List<LlmTestServerScenarioDataset> Datasets { get; init; } = [];
public string? RequiredBearerToken { get; init; }
public LlmTestServerFaultSimulation FaultSimulation { get; init; } = new();
public List<float> DefaultEmbeddingVector { get; init; } = [0.125f, 0.25f, 0.5f];
public string DefaultImageDataUri { get; init; } =
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGOSHzRgAAAAABJRU5ErkJggg==";
public byte[] DefaultAudioBytes { get; init; } =
Convert.FromBase64String("UklGRiQAAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQAAAAA=");
public string DefaultAudioMediaType { get; init; } = "audio/wav";
public string DefaultTranscriptionText { get; init; } = "transcribed audio fixture";
/// <summary>
/// Provider-reported usage returned for deterministic transcriptions, or <see langword="null"/>
/// to model providers that omit transcription usage.
/// </summary>
public LlmTestServerTranscriptionUsage? DefaultTranscriptionUsage { get; init; } = new();
public string DefaultTranslationText { get; init; } = "translated audio fixture";
public byte[] DefaultVideoBytes { get; init; } =
[
0x00,
0x00,
0x00,
0x18,
0x66,
0x74,
0x79,
0x70,
0x69,
0x73,
0x6F,
0x6D,
0x00,
0x00,
0x02,
0x00,
0x69,
0x73,
0x6F,
0x6D,
0x69,
0x73,
0x6F,
0x32,
];
public string DefaultVideoMediaType { get; init; } = "video/mp4";
public string DefaultVideoId { get; init; } = "video_llm_test_server";
public string DefaultVideoGenerationId { get; init; } = "gen_llm_test_server";
public long DefaultVideoCreatedAtUnixTime { get; init; } = 1712697600;
public string DefaultVideoSize { get; init; } = "1280x720";
public string DefaultVideoSeconds { get; init; } = "4";
public static LlmTestServerConfiguration CreateDefault()
{
return new()
{
Models =
[
new LlmTestServerModel { Id = LlmTestServerKnownModelIds.Gpt41Mini, Kind = LlmTestServerModelKind.Chat },
new LlmTestServerModel { Id = LlmTestServerKnownModelIds.TextEmbedding3Small, Kind = LlmTestServerModelKind.Embedding },
new LlmTestServerModel { Id = LlmTestServerKnownModelIds.GptImage1, Kind = LlmTestServerModelKind.Image },
new LlmTestServerModel { Id = LlmTestServerKnownModelIds.Gpt4OMiniTts, Kind = LlmTestServerModelKind.Audio },
new LlmTestServerModel { Id = LlmTestServerKnownModelIds.Sora2, Kind = LlmTestServerModelKind.Video },
],
};
}
}