lemonade-sdk 7.0.4__py3-none-any.whl → 8.0.1__py3-none-any.whl

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.

Potentially problematic release.


This version of lemonade-sdk might be problematic. Click here for more details.

Files changed (56) hide show
  1. lemonade/api.py +3 -3
  2. lemonade/cli.py +11 -17
  3. lemonade/common/build.py +0 -47
  4. lemonade/common/network.py +50 -0
  5. lemonade/common/status.py +2 -21
  6. lemonade/common/system_info.py +19 -4
  7. lemonade/profilers/memory_tracker.py +3 -1
  8. lemonade/tools/accuracy.py +3 -4
  9. lemonade/tools/adapter.py +1 -2
  10. lemonade/tools/{huggingface_bench.py → huggingface/bench.py} +2 -87
  11. lemonade/tools/huggingface/load.py +235 -0
  12. lemonade/tools/{huggingface_load.py → huggingface/utils.py} +87 -255
  13. lemonade/tools/humaneval.py +9 -3
  14. lemonade/tools/{llamacpp_bench.py → llamacpp/bench.py} +1 -1
  15. lemonade/tools/{llamacpp.py → llamacpp/load.py} +18 -2
  16. lemonade/tools/mmlu.py +7 -15
  17. lemonade/tools/{ort_genai/oga.py → oga/load.py} +31 -422
  18. lemonade/tools/oga/utils.py +423 -0
  19. lemonade/tools/perplexity.py +4 -3
  20. lemonade/tools/prompt.py +2 -1
  21. lemonade/tools/quark/quark_load.py +2 -1
  22. lemonade/tools/quark/quark_quantize.py +5 -5
  23. lemonade/tools/report/table.py +3 -3
  24. lemonade/tools/server/llamacpp.py +188 -45
  25. lemonade/tools/server/serve.py +184 -146
  26. lemonade/tools/server/static/favicon.ico +0 -0
  27. lemonade/tools/server/static/styles.css +568 -0
  28. lemonade/tools/server/static/webapp.html +439 -0
  29. lemonade/tools/server/tray.py +458 -0
  30. lemonade/tools/server/{port_utils.py → utils/port.py} +22 -3
  31. lemonade/tools/server/utils/system_tray.py +395 -0
  32. lemonade/tools/server/{instructions.py → webapp.py} +4 -10
  33. lemonade/version.py +1 -1
  34. lemonade_install/install.py +46 -28
  35. lemonade_sdk-8.0.1.dist-info/METADATA +179 -0
  36. lemonade_sdk-8.0.1.dist-info/RECORD +70 -0
  37. lemonade_server/cli.py +182 -27
  38. lemonade_server/model_manager.py +192 -20
  39. lemonade_server/pydantic_models.py +9 -4
  40. lemonade_server/server_models.json +5 -3
  41. lemonade/common/analyze_model.py +0 -26
  42. lemonade/common/labels.py +0 -61
  43. lemonade/common/onnx_helpers.py +0 -176
  44. lemonade/common/plugins.py +0 -10
  45. lemonade/common/tensor_helpers.py +0 -83
  46. lemonade/tools/server/static/instructions.html +0 -262
  47. lemonade_sdk-7.0.4.dist-info/METADATA +0 -113
  48. lemonade_sdk-7.0.4.dist-info/RECORD +0 -69
  49. /lemonade/tools/{ort_genai → oga}/__init__.py +0 -0
  50. /lemonade/tools/{ort_genai/oga_bench.py → oga/bench.py} +0 -0
  51. /lemonade/tools/server/{thread_utils.py → utils/thread.py} +0 -0
  52. {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/WHEEL +0 -0
  53. {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/entry_points.txt +0 -0
  54. {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/licenses/LICENSE +0 -0
  55. {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/licenses/NOTICE.md +0 -0
  56. {lemonade_sdk-7.0.4.dist-info → lemonade_sdk-8.0.1.dist-info}/top_level.txt +0 -0
@@ -295,6 +295,484 @@ body {
295
295
  cursor: wait;
296
296
  }
297
297
 
298
+ /* Model label styles */
299
+ .model-label {
300
+ display: inline-block;
301
+ background-color: #007acc;
302
+ color: white;
303
+ padding: 2px 8px;
304
+ margin-left: 8px;
305
+ border-radius: 4px;
306
+ font-size: 10px;
307
+ font-weight: 500;
308
+ text-transform: uppercase;
309
+ }
310
+
311
+ .model-label.reasoning {
312
+ background-color: #808080;
313
+ }
314
+
315
+ .model-label.vision {
316
+ background-color: #007acc;
317
+ }
318
+
319
+ .model-label.other {
320
+ background-color: #27ae60;
321
+ }
322
+
323
+ .model-labels-container {
324
+ display: flex;
325
+ align-items: center;
326
+ gap: 4px;
327
+ }
328
+
329
+ /* Model Registration Form */
330
+ .model-mgmt-register-form {
331
+ background: linear-gradient(135deg, #ffffff 0%, #fefdfb 100%);
332
+ border: 1px solid #e8e8e8;
333
+ border-radius: 12px;
334
+ margin-bottom: 1.5em;
335
+ padding: 1.5em 2em 1.2em 2em;
336
+ max-width: 750px;
337
+ margin-left: auto;
338
+ margin-right: auto;
339
+ box-shadow: 0 4px 20px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
340
+ position: relative;
341
+ overflow: visible;
342
+ transition: padding 0.3s ease;
343
+ }
344
+
345
+ /* Collapsed state */
346
+ .model-mgmt-register-form.collapsed {
347
+ padding: 1.5em 2em 1.2em 2em;
348
+ border: 1px solid #e0e0e0;
349
+ box-shadow: 0 2px 8px rgba(0,0,0,0.04);
350
+ }
351
+
352
+ .model-mgmt-register-form.collapsed .form-content {
353
+ display: none;
354
+ }
355
+
356
+ .model-mgmt-register-form::before {
357
+ content: '';
358
+ position: absolute;
359
+ top: 0;
360
+ left: 0;
361
+ right: 0;
362
+ height: 4px;
363
+ background: linear-gradient(90deg, #e6b800, #f4c842, #e6b800);
364
+ border-radius: 12px 12px 0 0;
365
+ }
366
+
367
+ .model-mgmt-form-title {
368
+ margin-top: 0;
369
+ color: #1a1a1a;
370
+ font-size: 1rem;
371
+ font-weight: 700;
372
+ margin-bottom: 1.2em;
373
+ letter-spacing: 0.01em;
374
+ display: flex;
375
+ align-items: center;
376
+ gap: 0.75em;
377
+ cursor: pointer;
378
+ user-select: none;
379
+ transition: all 0.2s ease;
380
+ }
381
+
382
+ .model-mgmt-form-title:hover {
383
+ color: #333;
384
+ }
385
+
386
+ /* Collapsed state title margin adjustment */
387
+ .model-mgmt-register-form.collapsed .model-mgmt-form-title {
388
+ margin-bottom: 0;
389
+ }
390
+
391
+ .model-mgmt-form-title::before {
392
+ content: '▶';
393
+ font-size: 0.8em;
394
+ color: #666;
395
+ transition: transform 0.3s ease;
396
+ transform-origin: center;
397
+ }
398
+
399
+ /* Rotate chevron when expanded */
400
+ .model-mgmt-register-form:not(.collapsed) .model-mgmt-form-title::before {
401
+ transform: rotate(90deg);
402
+ }
403
+
404
+ /* Hide the separate toggle indicator since we're using the gear */
405
+ .form-toggle-indicator {
406
+ display: none;
407
+ }
408
+
409
+ /* Specific styling for title tooltip */
410
+ .model-mgmt-form-title .tooltip-icon {
411
+ margin-left: 12px;
412
+ font-size: 16px;
413
+ }
414
+
415
+ .model-mgmt-form-title .tooltip-icon::after {
416
+ width: 250px;
417
+ font-size: 13px;
418
+ left: auto;
419
+ right: 0;
420
+ transform: translateX(0);
421
+ }
422
+
423
+ .model-mgmt-form-title .tooltip-icon:hover::after {
424
+ transform: translateX(0) translateY(-2px);
425
+ }
426
+
427
+ .register-form-row {
428
+ display: flex;
429
+ align-items: center;
430
+ gap: 1.2em;
431
+ margin-bottom: 1em;
432
+ padding: 0.1em 0;
433
+ position: relative;
434
+ }
435
+
436
+ .register-form-row-tight {
437
+ margin-bottom: 0.8em;
438
+ align-items: center;
439
+ flex-wrap: wrap;
440
+ }
441
+
442
+ .register-form-row:last-child {
443
+ margin-bottom: 0;
444
+ margin-top: 1.4em;
445
+ padding-top: 1em;
446
+ border-top: 1px solid #f0f0f0;
447
+ }
448
+
449
+ .register-label {
450
+ min-width: 120px;
451
+ color: #333;
452
+ font-weight: 600;
453
+ font-size: 0.95em;
454
+ text-transform: uppercase;
455
+ letter-spacing: 0.02em;
456
+ font-size: 0.85em;
457
+ }
458
+
459
+ .register-label.reasoning-inline {
460
+ margin-left: 1.5em;
461
+ font-weight: 500;
462
+ font-size: 0.9em;
463
+ color: #555;
464
+ display: flex;
465
+ align-items: center;
466
+ gap: 0.5em;
467
+ white-space: nowrap;
468
+ text-transform: none;
469
+ letter-spacing: normal;
470
+ }
471
+
472
+ .register-label.reasoning-inline input[type="checkbox"] {
473
+ transform: scale(1.1);
474
+ accent-color: #e6b800;
475
+ }
476
+
477
+ .register-model-name-group {
478
+ display: flex;
479
+ align-items: stretch;
480
+ flex: 1;
481
+ border-radius: 6px;
482
+ overflow: hidden;
483
+ transition: box-shadow 0.2s ease;
484
+ }
485
+
486
+ .register-model-name-group:focus-within {
487
+ box-shadow: 0 2px 12px rgba(230,184,0,0.25);
488
+ }
489
+
490
+ .register-model-prefix {
491
+ background: #e6b800;
492
+ color: #fff;
493
+ font-weight: 600;
494
+ border-radius: 4px 0 0 4px;
495
+ padding: 0.45em 0.7em;
496
+ font-size: 1em;
497
+ border: 1px solid #ddd;
498
+ border-right: none;
499
+ }
500
+
501
+ .styled-prefix {
502
+ background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
503
+ color: #666;
504
+ border: 1px solid #d5d5d5;
505
+ border-right: none;
506
+ border-radius: 6px 0 0 6px;
507
+ padding: 0.6em 0.8em;
508
+ font-size: 0.95em;
509
+ font-family: inherit;
510
+ font-weight: 500;
511
+ height: 100%;
512
+ display: flex;
513
+ align-items: center;
514
+ transition: all 0.2s ease;
515
+ min-width: 50px;
516
+ justify-content: center;
517
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06);
518
+ }
519
+
520
+ #register-model-name {
521
+ border-radius: 0 6px 6px 0;
522
+ border: 1px solid #d5d5d5;
523
+ border-left: none;
524
+ padding: 0.6em 0.8em;
525
+ font-size: 0.95em;
526
+ background: #fff;
527
+ color: #222;
528
+ flex: 1;
529
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
530
+ outline: none;
531
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06);
532
+ }
533
+
534
+ #register-model-name:focus {
535
+ border-color: #e6b800;
536
+ }
537
+
538
+ .form-input-wrapper {
539
+ position: relative;
540
+ width: 100%;
541
+ }
542
+
543
+ #register-recipe {
544
+ min-width: 160px;
545
+ flex: 1;
546
+ border-radius: 6px;
547
+ border: 1px solid #d5d5d5;
548
+ padding: 0.6em 0.8em;
549
+ font-size: 0.95em;
550
+ background: #fff;
551
+ color: #222;
552
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
553
+ outline: none;
554
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06);
555
+ }
556
+
557
+ #register-recipe:focus {
558
+ border-color: #e6b800;
559
+ box-shadow: 0 2px 12px rgba(230,184,0,0.25);
560
+ }
561
+
562
+ .register-doc-link {
563
+ margin-left: 0.8em;
564
+ color: #007acc;
565
+ font-size: 0.9em;
566
+ text-decoration: none;
567
+ transition: all 0.2s ease;
568
+ padding: 0.3em 0.6em;
569
+ border-radius: 4px;
570
+ background: rgba(0,122,204,0.1);
571
+ border: 1px solid rgba(0,122,204,0.2);
572
+ white-space: nowrap;
573
+ }
574
+
575
+ .register-doc-link:hover {
576
+ color: #fff;
577
+ background: #007acc;
578
+ border-color: #007acc;
579
+ transform: translateY(-1px);
580
+ box-shadow: 0 2px 8px rgba(0,122,204,0.3);
581
+ }
582
+
583
+ #register-mmproj, #register-checkpoint {
584
+ border-radius: 6px;
585
+ border: 1px solid #d5d5d5;
586
+ padding: 0.6em 0.8em;
587
+ font-size: 0.95em;
588
+ background: #fff;
589
+ color: #222;
590
+ flex: 1;
591
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
592
+ outline: none;
593
+ box-shadow: 0 2px 8px rgba(0,0,0,0.06);
594
+ }
595
+
596
+ #register-mmproj:focus, #register-checkpoint:focus {
597
+ border-color: #e6b800;
598
+ box-shadow: 0 2px 12px rgba(230,184,0,0.25);
599
+ }
600
+
601
+ #register-submit {
602
+ background: linear-gradient(135deg, #e6b800 0%, #f4c842 100%);
603
+ color: #222;
604
+ border: none;
605
+ border-radius: 8px;
606
+ padding: 0.8em 2em;
607
+ font-weight: 700;
608
+ font-size: 0.95em;
609
+ cursor: pointer;
610
+ transition: all 0.2s ease;
611
+ margin-top: 0;
612
+ box-shadow: 0 3px 12px rgba(230,184,0,0.3);
613
+ text-transform: uppercase;
614
+ letter-spacing: 0.02em;
615
+ position: relative;
616
+ overflow: hidden;
617
+ }
618
+
619
+ #register-submit::before {
620
+ content: '';
621
+ position: absolute;
622
+ top: 0;
623
+ left: -100%;
624
+ width: 100%;
625
+ height: 100%;
626
+ background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
627
+ transition: left 0.5s ease;
628
+ }
629
+
630
+ #register-submit:hover:enabled {
631
+ background: linear-gradient(135deg, #d4a500 0%, #e6b800 100%);
632
+ transform: translateY(-2px);
633
+ box-shadow: 0 5px 20px rgba(230,184,0,0.4);
634
+ }
635
+
636
+ #register-submit:hover:enabled::before {
637
+ left: 100%;
638
+ }
639
+
640
+ #register-submit:disabled {
641
+ background: linear-gradient(135deg, #ccc 0%, #bbb 100%);
642
+ color: #666;
643
+ cursor: not-allowed;
644
+ transform: none;
645
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
646
+ }
647
+
648
+ .register-status {
649
+ margin-left: 1.2em;
650
+ font-size: 0.95em;
651
+ font-weight: 600;
652
+ padding: 0.4em 0.8em;
653
+ border-radius: 6px;
654
+ transition: all 0.2s ease;
655
+ }
656
+
657
+ /* Make placeholder text in Add a Model form lighter and more elegant */
658
+ #register-model-form input::placeholder {
659
+ color: #aaa;
660
+ opacity: 1;
661
+ font-style: italic;
662
+ }
663
+
664
+ #register-model-form input:focus::placeholder {
665
+ color: #ccc;
666
+ transform: translateX(4px);
667
+ transition: all 0.2s ease;
668
+ }
669
+
670
+ /* Success status styling */
671
+ .register-status.success {
672
+ background: rgba(39, 174, 96, 0.1);
673
+ color: #27ae60;
674
+ border: 1px solid rgba(39, 174, 96, 0.3);
675
+ }
676
+
677
+ /* Error status styling */
678
+ .register-status.error {
679
+ background: rgba(220, 53, 69, 0.1);
680
+ color: #dc3545;
681
+ border: 1px solid rgba(220, 53, 69, 0.3);
682
+ }
683
+
684
+ /* Tooltip styles */
685
+ .tooltip-icon {
686
+ display: inline;
687
+ color: #007acc;
688
+ font-size: 14px;
689
+ margin-left: 8px;
690
+ cursor: help;
691
+ position: relative;
692
+ text-transform: none;
693
+ }
694
+
695
+ .tooltip-icon:hover {
696
+ color: #0086ef;
697
+ }
698
+
699
+ .tooltip-icon::after {
700
+ content: attr(data-tooltip);
701
+ position: absolute;
702
+ bottom: calc(100% + 8px);
703
+ left: 50%;
704
+ transform: translateX(-50%);
705
+ background-color: rgba(28, 28, 30, 0.98);
706
+ color: white;
707
+ padding: 10px 14px;
708
+ border-radius: 8px;
709
+ font-size: 12px;
710
+ font-weight: 400;
711
+ width: 200px;
712
+ text-align: left;
713
+ opacity: 0;
714
+ visibility: hidden;
715
+ transition: all 0.2s ease;
716
+ z-index: 1000;
717
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
718
+ border: 1px solid rgba(255, 255, 255, 0.15);
719
+ backdrop-filter: blur(8px);
720
+ line-height: 1.4;
721
+ pointer-events: none;
722
+ text-transform: none;
723
+ }
724
+
725
+ .tooltip-icon:hover::after {
726
+ opacity: 1;
727
+ visibility: visible;
728
+ transform: translateX(-50%) translateY(-2px);
729
+ }
730
+
731
+ /* Smart positioning for tooltips near edges */
732
+ .tooltip-icon:nth-last-child(-n+2)::after,
733
+ .register-form-row:last-child .tooltip-icon::after {
734
+ left: auto;
735
+ right: 0;
736
+ transform: translateX(0);
737
+ width: 180px;
738
+ }
739
+
740
+ .tooltip-icon:nth-last-child(-n+2):hover::after,
741
+ .register-form-row:last-child .tooltip-icon:hover::after {
742
+ transform: translateX(0) translateY(-2px);
743
+ }
744
+
745
+ /* Adjust label layout to accommodate tooltip icon */
746
+ .register-label {
747
+ display: flex;
748
+ align-items: center;
749
+ gap: 0.5em;
750
+ }
751
+
752
+ /* Adjust reasoning inline label for tooltip */
753
+ .register-label.reasoning-inline {
754
+ align-items: center;
755
+ }
756
+
757
+ .register-label.reasoning-inline .tooltip-icon {
758
+ margin-left: 8px;
759
+ }
760
+
761
+ /* Special positioning for reasoning tooltip to prevent overflow */
762
+ .register-label.reasoning-inline .tooltip-icon::after {
763
+ left: auto !important;
764
+ right: 0 !important;
765
+ transform: translateX(0) !important;
766
+ width: 160px !important;
767
+ max-width: 260px !important;
768
+ white-space: pre-line !important;
769
+ word-break: break-word !important;
770
+ }
771
+
772
+ .register-label.reasoning-inline .tooltip-icon:hover::after {
773
+ transform: translateX(0) translateY(-2px) !important;
774
+ }
775
+
298
776
  @media (max-width: 600px) {
299
777
  .title {
300
778
  font-size: 2rem;
@@ -310,4 +788,94 @@ body {
310
788
  flex-direction: column;
311
789
  gap: 1em;
312
790
  }
791
+ }
792
+
793
+ @media (max-width: 800px) {
794
+ .model-mgmt-register-form {
795
+ padding: 1.2em 1em 1em 1em;
796
+ margin: 0 1em 1.5em 1em;
797
+ }
798
+
799
+ .register-form-row {
800
+ flex-direction: column;
801
+ align-items: stretch;
802
+ gap: 0.6em;
803
+ }
804
+
805
+ .register-label {
806
+ min-width: 0;
807
+ font-size: 0.9em;
808
+ }
809
+
810
+ .register-label.reasoning-inline {
811
+ margin-left: 0;
812
+ margin-top: 0.5em;
813
+ justify-content: flex-start;
814
+ }
815
+
816
+ #register-model-name, #register-mmproj, #register-checkpoint {
817
+ min-width: 0;
818
+ width: 100%;
819
+ }
820
+
821
+ #register-recipe {
822
+ min-width: 0;
823
+ width: 100%;
824
+ }
825
+
826
+ .register-doc-link {
827
+ margin-left: 0;
828
+ margin-top: 0.5em;
829
+ align-self: flex-start;
830
+ }
831
+
832
+ .register-form-row:last-child {
833
+ flex-direction: row;
834
+ justify-content: space-between;
835
+ align-items: center;
836
+ flex-wrap: wrap;
837
+ gap: 1em;
838
+ }
839
+
840
+ #register-submit {
841
+ padding: 0.8em 1.5em;
842
+ font-size: 0.9em;
843
+ }
844
+ }
845
+
846
+ /* Ensure form container allows tooltip overflow */
847
+ .model-mgmt-register-form {
848
+ position: relative;
849
+ overflow: visible;
850
+ }
851
+
852
+ .register-form-row {
853
+ position: relative;
854
+ }
855
+
856
+ /* Additional positioning rules for better tooltip placement */
857
+ .register-label .tooltip-icon::after {
858
+ width: 200px;
859
+ }
860
+
861
+ /* Ensure tooltips for rightmost elements don't get cut off */
862
+ .register-form-row-tight .tooltip-icon:last-child::after {
863
+ left: auto;
864
+ right: 0;
865
+ transform: translateX(0);
866
+ width: 180px;
867
+ }
868
+
869
+ .register-form-row-tight .tooltip-icon:last-child:hover::after {
870
+ transform: translateX(0) translateY(-2px);
871
+ }
872
+
873
+ .register-form-row-tight .tooltip-icon:last-child::before {
874
+ left: auto;
875
+ right: 8px;
876
+ transform: translateX(0);
877
+ }
878
+
879
+ .register-form-row-tight .tooltip-icon:last-child:hover::before {
880
+ transform: translateX(0) translateY(-2px);
313
881
  }