20
20
display : grid;
21
21
grid-template-columns : 1fr 1fr ;
22
22
gap : 20px ;
23
- max-width : 1200 px ;
23
+ max-width : 1400 px ;
24
24
margin : 0 auto;
25
+ grid-template-areas :
26
+ "terminal1 terminal3"
27
+ "terminal2 terminal3" ;
25
28
}
26
29
27
30
.terminal {
28
31
background : # 1e1e1e ;
29
32
border : 1px solid # 333 ;
30
33
border-radius : 8px ;
31
34
padding : 15px ;
32
- min-height : 220px ;
33
- max-height : 250px ;
35
+ min-height : 300px ;
34
36
position : relative;
35
- overflow-y : auto;
36
37
}
37
38
38
39
.terminal-header {
73
74
font-size : 16px ;
74
75
}
75
76
76
- .terminal-full {
77
- grid-column : 1 / -1 ;
78
- margin-top : 20px ;
79
- min-height : 300px ;
80
- max-height : none;
77
+ .terminal1 {
78
+ grid-area : terminal1;
79
+ }
80
+
81
+ .terminal2 {
82
+ grid-area : terminal2;
83
+ }
84
+
85
+ .terminal3 {
86
+ grid-area : terminal3;
87
+ min-height : 500px ;
88
+ max-height : 600px ;
89
+ font-size : 12px ;
90
+ line-height : 1.2 ;
81
91
}
82
92
</ style >
83
93
</ head >
84
94
< body >
85
95
< div class ="title "> 🚀 LLM Katan Multi-Instance Demo</ div >
86
- < div class ="description "> Run the same tiny model as different AI providers for testing </ div >
96
+ < div class ="description "> Multi-instance setup + Enhanced OpenAI API compatibility showcase </ div >
87
97
88
98
< div class ="terminal-container ">
89
- < div class ="terminal ">
99
+ < div class ="terminal terminal1 ">
90
100
< div class ="terminal-header "> Terminal 1: GPT-3.5-Turbo Instance</ div >
91
101
< div id ="terminal1 "> </ div >
92
102
</ div >
93
103
94
- < div class ="terminal ">
104
+ < div class ="terminal terminal2 ">
95
105
< div class ="terminal-header "> Terminal 2: Claude-3-Haiku Instance</ div >
96
106
< div id ="terminal2 "> </ div >
97
107
</ div >
98
108
99
- < div class ="terminal terminal-full ">
100
- < div class ="terminal-header "> Terminal 3: Testing Both Endpoints </ div >
109
+ < div class ="terminal terminal3 ">
110
+ < div class ="terminal-header "> Terminal 3: Testing Enhanced OpenAI Compatibility </ div >
101
111
< div id ="terminal3 "> </ div >
102
112
</ div >
103
113
</ div >
148
158
// Terminal 3: Testing both endpoints (starts after both servers finish)
149
159
setTimeout ( ( ) => {
150
160
new TypeIt ( "#terminal3" , {
151
- speed : 50 ,
161
+ speed : 17 ,
152
162
waitUntilVisible : true
153
163
} )
154
- . type ( '<span class="success"># Both servers are now running! Let\'s test them ...</span>' )
164
+ . type ( '<span class="success"># Both servers are now running! Let\'s test enhanced OpenAI compatibility ...</span>' )
155
165
. break ( )
156
166
. break ( )
157
167
. pause ( 1000 )
160
170
. type ( '<span class="output">"gpt-3.5-turbo"</span>' )
161
171
. break ( )
162
172
. break ( )
163
- . pause ( 1500 )
173
+ . pause ( 1000 )
164
174
. type ( '<span class="prompt">$</span> <span class="command">curl http://localhost:8001/v1/models | jq \'.data[0].id\'</span>' )
165
175
. break ( )
166
176
. type ( '<span class="output">"claude-3-haiku"</span>' )
167
177
. break ( )
168
178
. break ( )
169
- . pause ( 1500 )
170
- . type ( '<span class="success"># Same Qwen3-0.6B model, different API names!</span>' )
171
- . break ( )
172
- . type ( '<span class="success"># Perfect for testing multi-provider scenarios 🎯</span>' )
173
- . break ( )
174
- . break ( )
175
179
. pause ( 1000 )
176
- . type ( '<span class="prompt">$</span> <span class="command"># Try a chat completion with "GPT" </span>' )
180
+ . type ( '<span class="success"># Testing full OpenAI-compatible response </span>' )
177
181
. break ( )
178
182
. type ( '<span class="prompt">$</span> <span class="command">curl -X POST http://localhost:8000/v1/chat/completions \\</span>' )
179
183
. break ( )
180
184
. type ( '<span class="command"> -H "Content-Type: application/json" \\</span>' )
181
185
. break ( )
182
186
. type ( '<span class="command"> -d \'{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hi!"}]}\'</span>' )
183
187
. break ( )
184
- . type ( '<span class="output">{"choices": [{"message": {"content": "Hello! How can I help you today?"}}]}</span>' )
188
+ . pause ( 1000 )
189
+ . type ( '<span class="output">{</span>' )
190
+ . break ( )
191
+ . type ( '<span class="output"> "id": "cmpl-mock-1734567890",</span>' )
192
+ . break ( )
193
+ . type ( '<span class="output"> "object": "chat.completion",</span>' )
194
+ . break ( )
195
+ . type ( '<span class="output"> "created": 1734567890,</span>' )
196
+ . break ( )
197
+ . type ( '<span class="output"> "model": "gpt-3.5-turbo",</span>' )
198
+ . break ( )
199
+ . type ( '<span class="output"> "system_fingerprint": "llm-katan-v0.1.8",</span>' )
200
+ . break ( )
201
+ . type ( '<span class="output"> "choices": [{</span>' )
202
+ . break ( )
203
+ . type ( '<span class="output"> "index": 0,</span>' )
204
+ . break ( )
205
+ . type ( '<span class="output"> "message": {"role": "assistant", "content": "Hello! How can I help?"},</span>' )
206
+ . break ( )
207
+ . type ( '<span class="output"> "finish_reason": "stop",</span>' )
208
+ . break ( )
209
+ . type ( '<span class="output"> "logprobs": null</span>' )
210
+ . break ( )
211
+ . type ( '<span class="output"> }],</span>' )
212
+ . break ( )
213
+ . type ( '<span class="output"> "usage": {</span>' )
214
+ . break ( )
215
+ . type ( '<span class="output"> "prompt_tokens": 12,</span>' )
216
+ . break ( )
217
+ . type ( '<span class="output"> "completion_tokens": 8,</span>' )
218
+ . break ( )
219
+ . type ( '<span class="output"> "total_tokens": 20,</span>' )
220
+ . break ( )
221
+ . type ( '<span class="output"> "prompt_tokens_details": {"cached_tokens": 0},</span>' )
222
+ . break ( )
223
+ . type ( '<span class="output"> "completion_tokens_details": {"reasoning_tokens": 0}</span>' )
224
+ . break ( )
225
+ . type ( '<span class="output"> },</span>' )
226
+ . break ( )
227
+ . type ( '<span class="output"> "token_usage": {</span>' )
228
+ . break ( )
229
+ . type ( '<span class="output"> "prompt_tokens": 12, "completion_tokens": 8, "total_tokens": 20</span>' )
230
+ . break ( )
231
+ . type ( '<span class="output"> }</span>' )
232
+ . break ( )
233
+ . type ( '<span class="output">}</span>' )
234
+ . break ( )
235
+ . pause ( 1000 )
236
+ . type ( '<span class="success"># ✨ Enhanced compatibility with all OpenAI SDK fields!</span>' )
237
+ . break ( )
238
+ . type ( '<span class="success"># 🎯 Same tiny model, multiple providers, full API support</span>' )
185
239
. go ( ) ;
186
- } , 10000 ) ; // Start after both terminals complete (~10 seconds)
240
+ } , 8500 ) ; // Start after both terminals complete (~8.5 seconds)
187
241
</ script >
188
242
</ body >
189
243
</ html >
0 commit comments