local-llm-gateway 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,755 @@
1
+ {
2
+ "id": "d8f67e59-cd0d-4a70-902f-b5497c83aa30",
3
+ "prevId": "6b58bd4b-ad94-4b56-9f32-dba2ffae12a2",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.api_keys": {
8
+ "name": "api_keys",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "user_id": {
19
+ "name": "user_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "key_hash": {
25
+ "name": "key_hash",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "label": {
31
+ "name": "label",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "created_at": {
37
+ "name": "created_at",
38
+ "type": "timestamp with time zone",
39
+ "primaryKey": false,
40
+ "notNull": true,
41
+ "default": "now()"
42
+ },
43
+ "revoked_at": {
44
+ "name": "revoked_at",
45
+ "type": "timestamp with time zone",
46
+ "primaryKey": false,
47
+ "notNull": false
48
+ }
49
+ },
50
+ "indexes": {},
51
+ "foreignKeys": {
52
+ "api_keys_user_id_users_id_fk": {
53
+ "name": "api_keys_user_id_users_id_fk",
54
+ "tableFrom": "api_keys",
55
+ "tableTo": "users",
56
+ "columnsFrom": [
57
+ "user_id"
58
+ ],
59
+ "columnsTo": [
60
+ "id"
61
+ ],
62
+ "onDelete": "no action",
63
+ "onUpdate": "no action"
64
+ }
65
+ },
66
+ "compositePrimaryKeys": {},
67
+ "uniqueConstraints": {
68
+ "api_keys_key_hash_unique": {
69
+ "name": "api_keys_key_hash_unique",
70
+ "nullsNotDistinct": false,
71
+ "columns": [
72
+ "key_hash"
73
+ ]
74
+ }
75
+ },
76
+ "policies": {},
77
+ "checkConstraints": {},
78
+ "isRLSEnabled": false
79
+ },
80
+ "public.conversations": {
81
+ "name": "conversations",
82
+ "schema": "",
83
+ "columns": {
84
+ "id": {
85
+ "name": "id",
86
+ "type": "uuid",
87
+ "primaryKey": true,
88
+ "notNull": true,
89
+ "default": "gen_random_uuid()"
90
+ },
91
+ "user_id": {
92
+ "name": "user_id",
93
+ "type": "uuid",
94
+ "primaryKey": false,
95
+ "notNull": true
96
+ },
97
+ "title": {
98
+ "name": "title",
99
+ "type": "text",
100
+ "primaryKey": false,
101
+ "notNull": false
102
+ },
103
+ "default_model": {
104
+ "name": "default_model",
105
+ "type": "text",
106
+ "primaryKey": false,
107
+ "notNull": true
108
+ },
109
+ "system_prompt": {
110
+ "name": "system_prompt",
111
+ "type": "text",
112
+ "primaryKey": false,
113
+ "notNull": false
114
+ },
115
+ "parent_conversation_id": {
116
+ "name": "parent_conversation_id",
117
+ "type": "uuid",
118
+ "primaryKey": false,
119
+ "notNull": false
120
+ },
121
+ "forked_from_message_id": {
122
+ "name": "forked_from_message_id",
123
+ "type": "uuid",
124
+ "primaryKey": false,
125
+ "notNull": false
126
+ },
127
+ "lease_until": {
128
+ "name": "lease_until",
129
+ "type": "timestamp with time zone",
130
+ "primaryKey": false,
131
+ "notNull": false
132
+ },
133
+ "created_at": {
134
+ "name": "created_at",
135
+ "type": "timestamp with time zone",
136
+ "primaryKey": false,
137
+ "notNull": true,
138
+ "default": "now()"
139
+ },
140
+ "updated_at": {
141
+ "name": "updated_at",
142
+ "type": "timestamp (3) with time zone",
143
+ "primaryKey": false,
144
+ "notNull": true,
145
+ "default": "now()"
146
+ }
147
+ },
148
+ "indexes": {
149
+ "conversations_user_updated_idx": {
150
+ "name": "conversations_user_updated_idx",
151
+ "columns": [
152
+ {
153
+ "expression": "user_id",
154
+ "isExpression": false,
155
+ "asc": true,
156
+ "nulls": "last"
157
+ },
158
+ {
159
+ "expression": "updated_at",
160
+ "isExpression": false,
161
+ "asc": true,
162
+ "nulls": "last"
163
+ }
164
+ ],
165
+ "isUnique": false,
166
+ "concurrently": false,
167
+ "method": "btree",
168
+ "with": {}
169
+ },
170
+ "conversations_parent_idx": {
171
+ "name": "conversations_parent_idx",
172
+ "columns": [
173
+ {
174
+ "expression": "parent_conversation_id",
175
+ "isExpression": false,
176
+ "asc": true,
177
+ "nulls": "last"
178
+ }
179
+ ],
180
+ "isUnique": false,
181
+ "concurrently": false,
182
+ "method": "btree",
183
+ "with": {}
184
+ }
185
+ },
186
+ "foreignKeys": {
187
+ "conversations_user_id_users_id_fk": {
188
+ "name": "conversations_user_id_users_id_fk",
189
+ "tableFrom": "conversations",
190
+ "tableTo": "users",
191
+ "columnsFrom": [
192
+ "user_id"
193
+ ],
194
+ "columnsTo": [
195
+ "id"
196
+ ],
197
+ "onDelete": "no action",
198
+ "onUpdate": "no action"
199
+ },
200
+ "conversations_parent_conversation_id_conversations_id_fk": {
201
+ "name": "conversations_parent_conversation_id_conversations_id_fk",
202
+ "tableFrom": "conversations",
203
+ "tableTo": "conversations",
204
+ "columnsFrom": [
205
+ "parent_conversation_id"
206
+ ],
207
+ "columnsTo": [
208
+ "id"
209
+ ],
210
+ "onDelete": "set null",
211
+ "onUpdate": "no action"
212
+ },
213
+ "conversations_forked_from_message_id_messages_id_fk": {
214
+ "name": "conversations_forked_from_message_id_messages_id_fk",
215
+ "tableFrom": "conversations",
216
+ "tableTo": "messages",
217
+ "columnsFrom": [
218
+ "forked_from_message_id"
219
+ ],
220
+ "columnsTo": [
221
+ "id"
222
+ ],
223
+ "onDelete": "set null",
224
+ "onUpdate": "no action"
225
+ }
226
+ },
227
+ "compositePrimaryKeys": {},
228
+ "uniqueConstraints": {},
229
+ "policies": {},
230
+ "checkConstraints": {},
231
+ "isRLSEnabled": false
232
+ },
233
+ "public.generations": {
234
+ "name": "generations",
235
+ "schema": "",
236
+ "columns": {
237
+ "id": {
238
+ "name": "id",
239
+ "type": "uuid",
240
+ "primaryKey": true,
241
+ "notNull": true,
242
+ "default": "gen_random_uuid()"
243
+ },
244
+ "request_id": {
245
+ "name": "request_id",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": true
249
+ },
250
+ "user_id": {
251
+ "name": "user_id",
252
+ "type": "uuid",
253
+ "primaryKey": false,
254
+ "notNull": true
255
+ },
256
+ "conversation_id": {
257
+ "name": "conversation_id",
258
+ "type": "uuid",
259
+ "primaryKey": false,
260
+ "notNull": false
261
+ },
262
+ "message_id": {
263
+ "name": "message_id",
264
+ "type": "uuid",
265
+ "primaryKey": false,
266
+ "notNull": false
267
+ },
268
+ "provider": {
269
+ "name": "provider",
270
+ "type": "text",
271
+ "primaryKey": false,
272
+ "notNull": true
273
+ },
274
+ "model": {
275
+ "name": "model",
276
+ "type": "text",
277
+ "primaryKey": false,
278
+ "notNull": true
279
+ },
280
+ "prompt_tokens": {
281
+ "name": "prompt_tokens",
282
+ "type": "integer",
283
+ "primaryKey": false,
284
+ "notNull": false
285
+ },
286
+ "completion_tokens": {
287
+ "name": "completion_tokens",
288
+ "type": "integer",
289
+ "primaryKey": false,
290
+ "notNull": false
291
+ },
292
+ "est_prompt_tokens": {
293
+ "name": "est_prompt_tokens",
294
+ "type": "integer",
295
+ "primaryKey": false,
296
+ "notNull": false
297
+ },
298
+ "queue_wait_ms": {
299
+ "name": "queue_wait_ms",
300
+ "type": "integer",
301
+ "primaryKey": false,
302
+ "notNull": false
303
+ },
304
+ "ttft_ms": {
305
+ "name": "ttft_ms",
306
+ "type": "integer",
307
+ "primaryKey": false,
308
+ "notNull": false
309
+ },
310
+ "generation_ms": {
311
+ "name": "generation_ms",
312
+ "type": "integer",
313
+ "primaryKey": false,
314
+ "notNull": false
315
+ },
316
+ "total_ms": {
317
+ "name": "total_ms",
318
+ "type": "integer",
319
+ "primaryKey": false,
320
+ "notNull": false
321
+ },
322
+ "status": {
323
+ "name": "status",
324
+ "type": "text",
325
+ "primaryKey": false,
326
+ "notNull": true
327
+ },
328
+ "error_code": {
329
+ "name": "error_code",
330
+ "type": "text",
331
+ "primaryKey": false,
332
+ "notNull": false
333
+ },
334
+ "created_at": {
335
+ "name": "created_at",
336
+ "type": "timestamp with time zone",
337
+ "primaryKey": false,
338
+ "notNull": true,
339
+ "default": "now()"
340
+ }
341
+ },
342
+ "indexes": {
343
+ "generations_user_created_idx": {
344
+ "name": "generations_user_created_idx",
345
+ "columns": [
346
+ {
347
+ "expression": "user_id",
348
+ "isExpression": false,
349
+ "asc": true,
350
+ "nulls": "last"
351
+ },
352
+ {
353
+ "expression": "created_at",
354
+ "isExpression": false,
355
+ "asc": true,
356
+ "nulls": "last"
357
+ }
358
+ ],
359
+ "isUnique": false,
360
+ "concurrently": false,
361
+ "method": "btree",
362
+ "with": {}
363
+ },
364
+ "generations_request_idx": {
365
+ "name": "generations_request_idx",
366
+ "columns": [
367
+ {
368
+ "expression": "request_id",
369
+ "isExpression": false,
370
+ "asc": true,
371
+ "nulls": "last"
372
+ }
373
+ ],
374
+ "isUnique": false,
375
+ "concurrently": false,
376
+ "method": "btree",
377
+ "with": {}
378
+ }
379
+ },
380
+ "foreignKeys": {
381
+ "generations_user_id_users_id_fk": {
382
+ "name": "generations_user_id_users_id_fk",
383
+ "tableFrom": "generations",
384
+ "tableTo": "users",
385
+ "columnsFrom": [
386
+ "user_id"
387
+ ],
388
+ "columnsTo": [
389
+ "id"
390
+ ],
391
+ "onDelete": "no action",
392
+ "onUpdate": "no action"
393
+ },
394
+ "generations_conversation_id_conversations_id_fk": {
395
+ "name": "generations_conversation_id_conversations_id_fk",
396
+ "tableFrom": "generations",
397
+ "tableTo": "conversations",
398
+ "columnsFrom": [
399
+ "conversation_id"
400
+ ],
401
+ "columnsTo": [
402
+ "id"
403
+ ],
404
+ "onDelete": "set null",
405
+ "onUpdate": "no action"
406
+ }
407
+ },
408
+ "compositePrimaryKeys": {},
409
+ "uniqueConstraints": {},
410
+ "policies": {},
411
+ "checkConstraints": {},
412
+ "isRLSEnabled": false
413
+ },
414
+ "public.messages": {
415
+ "name": "messages",
416
+ "schema": "",
417
+ "columns": {
418
+ "id": {
419
+ "name": "id",
420
+ "type": "uuid",
421
+ "primaryKey": true,
422
+ "notNull": true,
423
+ "default": "gen_random_uuid()"
424
+ },
425
+ "seq": {
426
+ "name": "seq",
427
+ "type": "bigserial",
428
+ "primaryKey": false,
429
+ "notNull": true
430
+ },
431
+ "conversation_id": {
432
+ "name": "conversation_id",
433
+ "type": "uuid",
434
+ "primaryKey": false,
435
+ "notNull": true
436
+ },
437
+ "role": {
438
+ "name": "role",
439
+ "type": "text",
440
+ "primaryKey": false,
441
+ "notNull": true
442
+ },
443
+ "content": {
444
+ "name": "content",
445
+ "type": "text",
446
+ "primaryKey": false,
447
+ "notNull": true
448
+ },
449
+ "status": {
450
+ "name": "status",
451
+ "type": "text",
452
+ "primaryKey": false,
453
+ "notNull": true,
454
+ "default": "'complete'"
455
+ },
456
+ "model": {
457
+ "name": "model",
458
+ "type": "text",
459
+ "primaryKey": false,
460
+ "notNull": false
461
+ },
462
+ "created_at": {
463
+ "name": "created_at",
464
+ "type": "timestamp with time zone",
465
+ "primaryKey": false,
466
+ "notNull": true,
467
+ "default": "now()"
468
+ }
469
+ },
470
+ "indexes": {
471
+ "messages_conv_seq_idx": {
472
+ "name": "messages_conv_seq_idx",
473
+ "columns": [
474
+ {
475
+ "expression": "conversation_id",
476
+ "isExpression": false,
477
+ "asc": true,
478
+ "nulls": "last"
479
+ },
480
+ {
481
+ "expression": "seq",
482
+ "isExpression": false,
483
+ "asc": true,
484
+ "nulls": "last"
485
+ }
486
+ ],
487
+ "isUnique": false,
488
+ "concurrently": false,
489
+ "method": "btree",
490
+ "with": {}
491
+ }
492
+ },
493
+ "foreignKeys": {
494
+ "messages_conversation_id_conversations_id_fk": {
495
+ "name": "messages_conversation_id_conversations_id_fk",
496
+ "tableFrom": "messages",
497
+ "tableTo": "conversations",
498
+ "columnsFrom": [
499
+ "conversation_id"
500
+ ],
501
+ "columnsTo": [
502
+ "id"
503
+ ],
504
+ "onDelete": "cascade",
505
+ "onUpdate": "no action"
506
+ }
507
+ },
508
+ "compositePrimaryKeys": {},
509
+ "uniqueConstraints": {},
510
+ "policies": {},
511
+ "checkConstraints": {},
512
+ "isRLSEnabled": false
513
+ },
514
+ "public.users": {
515
+ "name": "users",
516
+ "schema": "",
517
+ "columns": {
518
+ "id": {
519
+ "name": "id",
520
+ "type": "uuid",
521
+ "primaryKey": true,
522
+ "notNull": true,
523
+ "default": "gen_random_uuid()"
524
+ },
525
+ "email": {
526
+ "name": "email",
527
+ "type": "text",
528
+ "primaryKey": false,
529
+ "notNull": true
530
+ },
531
+ "created_at": {
532
+ "name": "created_at",
533
+ "type": "timestamp with time zone",
534
+ "primaryKey": false,
535
+ "notNull": true,
536
+ "default": "now()"
537
+ }
538
+ },
539
+ "indexes": {},
540
+ "foreignKeys": {},
541
+ "compositePrimaryKeys": {},
542
+ "uniqueConstraints": {
543
+ "users_email_unique": {
544
+ "name": "users_email_unique",
545
+ "nullsNotDistinct": false,
546
+ "columns": [
547
+ "email"
548
+ ]
549
+ }
550
+ },
551
+ "policies": {},
552
+ "checkConstraints": {},
553
+ "isRLSEnabled": false
554
+ },
555
+ "public.web_codes": {
556
+ "name": "web_codes",
557
+ "schema": "",
558
+ "columns": {
559
+ "id": {
560
+ "name": "id",
561
+ "type": "uuid",
562
+ "primaryKey": true,
563
+ "notNull": true,
564
+ "default": "gen_random_uuid()"
565
+ },
566
+ "user_id": {
567
+ "name": "user_id",
568
+ "type": "uuid",
569
+ "primaryKey": false,
570
+ "notNull": true
571
+ },
572
+ "code_hash": {
573
+ "name": "code_hash",
574
+ "type": "text",
575
+ "primaryKey": false,
576
+ "notNull": true
577
+ },
578
+ "purpose": {
579
+ "name": "purpose",
580
+ "type": "text",
581
+ "primaryKey": false,
582
+ "notNull": true,
583
+ "default": "'open'"
584
+ },
585
+ "expires_at": {
586
+ "name": "expires_at",
587
+ "type": "timestamp with time zone",
588
+ "primaryKey": false,
589
+ "notNull": true
590
+ },
591
+ "used_at": {
592
+ "name": "used_at",
593
+ "type": "timestamp with time zone",
594
+ "primaryKey": false,
595
+ "notNull": false
596
+ },
597
+ "created_at": {
598
+ "name": "created_at",
599
+ "type": "timestamp with time zone",
600
+ "primaryKey": false,
601
+ "notNull": true,
602
+ "default": "now()"
603
+ }
604
+ },
605
+ "indexes": {},
606
+ "foreignKeys": {
607
+ "web_codes_user_id_users_id_fk": {
608
+ "name": "web_codes_user_id_users_id_fk",
609
+ "tableFrom": "web_codes",
610
+ "tableTo": "users",
611
+ "columnsFrom": [
612
+ "user_id"
613
+ ],
614
+ "columnsTo": [
615
+ "id"
616
+ ],
617
+ "onDelete": "no action",
618
+ "onUpdate": "no action"
619
+ }
620
+ },
621
+ "compositePrimaryKeys": {},
622
+ "uniqueConstraints": {
623
+ "web_codes_code_hash_unique": {
624
+ "name": "web_codes_code_hash_unique",
625
+ "nullsNotDistinct": false,
626
+ "columns": [
627
+ "code_hash"
628
+ ]
629
+ }
630
+ },
631
+ "policies": {},
632
+ "checkConstraints": {},
633
+ "isRLSEnabled": false
634
+ },
635
+ "public.web_sessions": {
636
+ "name": "web_sessions",
637
+ "schema": "",
638
+ "columns": {
639
+ "id": {
640
+ "name": "id",
641
+ "type": "uuid",
642
+ "primaryKey": true,
643
+ "notNull": true,
644
+ "default": "gen_random_uuid()"
645
+ },
646
+ "user_id": {
647
+ "name": "user_id",
648
+ "type": "uuid",
649
+ "primaryKey": false,
650
+ "notNull": true
651
+ },
652
+ "token_hash": {
653
+ "name": "token_hash",
654
+ "type": "text",
655
+ "primaryKey": false,
656
+ "notNull": true
657
+ },
658
+ "device_name": {
659
+ "name": "device_name",
660
+ "type": "text",
661
+ "primaryKey": false,
662
+ "notNull": false
663
+ },
664
+ "created_from": {
665
+ "name": "created_from",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": true,
669
+ "default": "'local'"
670
+ },
671
+ "created_at": {
672
+ "name": "created_at",
673
+ "type": "timestamp with time zone",
674
+ "primaryKey": false,
675
+ "notNull": true,
676
+ "default": "now()"
677
+ },
678
+ "last_seen_at": {
679
+ "name": "last_seen_at",
680
+ "type": "timestamp with time zone",
681
+ "primaryKey": false,
682
+ "notNull": true
683
+ },
684
+ "expires_at": {
685
+ "name": "expires_at",
686
+ "type": "timestamp with time zone",
687
+ "primaryKey": false,
688
+ "notNull": true
689
+ },
690
+ "revoked_at": {
691
+ "name": "revoked_at",
692
+ "type": "timestamp with time zone",
693
+ "primaryKey": false,
694
+ "notNull": false
695
+ }
696
+ },
697
+ "indexes": {
698
+ "web_sessions_user_idx": {
699
+ "name": "web_sessions_user_idx",
700
+ "columns": [
701
+ {
702
+ "expression": "user_id",
703
+ "isExpression": false,
704
+ "asc": true,
705
+ "nulls": "last"
706
+ }
707
+ ],
708
+ "isUnique": false,
709
+ "concurrently": false,
710
+ "method": "btree",
711
+ "with": {}
712
+ }
713
+ },
714
+ "foreignKeys": {
715
+ "web_sessions_user_id_users_id_fk": {
716
+ "name": "web_sessions_user_id_users_id_fk",
717
+ "tableFrom": "web_sessions",
718
+ "tableTo": "users",
719
+ "columnsFrom": [
720
+ "user_id"
721
+ ],
722
+ "columnsTo": [
723
+ "id"
724
+ ],
725
+ "onDelete": "no action",
726
+ "onUpdate": "no action"
727
+ }
728
+ },
729
+ "compositePrimaryKeys": {},
730
+ "uniqueConstraints": {
731
+ "web_sessions_token_hash_unique": {
732
+ "name": "web_sessions_token_hash_unique",
733
+ "nullsNotDistinct": false,
734
+ "columns": [
735
+ "token_hash"
736
+ ]
737
+ }
738
+ },
739
+ "policies": {},
740
+ "checkConstraints": {},
741
+ "isRLSEnabled": false
742
+ }
743
+ },
744
+ "enums": {},
745
+ "schemas": {},
746
+ "sequences": {},
747
+ "roles": {},
748
+ "policies": {},
749
+ "views": {},
750
+ "_meta": {
751
+ "columns": {},
752
+ "schemas": {},
753
+ "tables": {}
754
+ }
755
+ }