File size: 36,476 Bytes
b378e61
 
 
 
 
e86e389
 
0cd8b82
 
 
b378e61
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
 
 
 
 
 
 
b378e61
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e86e389
b378e61
0cd8b82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0cd8b82
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0cd8b82
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b378e61
 
 
 
 
e86e389
b378e61
e86e389
b378e61
 
 
 
e86e389
b378e61
 
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
 
 
e86e389
f6f4ad9
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
e86e389
f6f4ad9
 
 
 
 
e86e389
f6f4ad9
 
e86e389
f6f4ad9
e86e389
b378e61
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
 
b378e61
 
f6f4ad9
 
 
 
 
 
b378e61
 
f6f4ad9
 
 
b378e61
f6f4ad9
b378e61
 
f6f4ad9
b378e61
f6f4ad9
 
b378e61
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
e86e389
 
 
 
 
f6f4ad9
e86e389
f6f4ad9
e86e389
 
 
b378e61
 
 
 
 
0cd8b82
f6f4ad9
b378e61
f6f4ad9
b378e61
 
f6f4ad9
e86e389
f6f4ad9
 
 
 
 
 
 
b378e61
 
 
 
0cd8b82
b378e61
0cd8b82
b378e61
e86e389
b378e61
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e86e389
 
b378e61
f6f4ad9
 
 
 
 
b378e61
 
f6f4ad9
 
 
b378e61
f6f4ad9
 
 
 
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
b378e61
f6f4ad9
 
 
 
 
 
 
b378e61
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b378e61
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
0cd8b82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b378e61
f6f4ad9
b378e61
 
f6f4ad9
 
0cd8b82
 
b378e61
 
0cd8b82
 
 
 
 
 
 
 
 
 
 
 
 
 
f6f4ad9
b378e61
f6f4ad9
0cd8b82
b378e61
 
 
 
 
f6f4ad9
b378e61
 
 
 
f6f4ad9
b378e61
 
 
 
 
f6f4ad9
b378e61
 
f6f4ad9
 
b378e61
f6f4ad9
 
 
 
b378e61
f6f4ad9
 
 
 
 
 
b378e61
f6f4ad9
b378e61
0cd8b82
f6f4ad9
 
 
 
 
e86e389
f6f4ad9
 
 
 
 
e86e389
f6f4ad9
e86e389
f6f4ad9
 
 
 
 
 
 
 
0cd8b82
e86e389
f6f4ad9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e86e389
f6f4ad9
 
 
 
e86e389
f6f4ad9
 
 
e86e389
 
f6f4ad9
 
 
 
e86e389
 
f6f4ad9
 
 
e86e389
f6f4ad9
 
b378e61
f6f4ad9
 
b378e61
 
f6f4ad9
b378e61
 
 
 
f6f4ad9
b378e61
f6f4ad9
b378e61
e86e389
f6f4ad9
 
b378e61
 
 
 
 
0cd8b82
b378e61
 
 
e86e389
f6f4ad9
 
 
 
 
b378e61
f6f4ad9
b378e61
 
f6f4ad9
 
b378e61
f6f4ad9
b378e61
0cd8b82
f6f4ad9
0cd8b82
f6f4ad9
b378e61
 
0cd8b82
b378e61
 
e86e389
f6f4ad9
 
 
 
 
b378e61
 
 
f6f4ad9
b378e61
0cd8b82
f6f4ad9
0cd8b82
f6f4ad9
b378e61
 
0cd8b82
b378e61
 
e86e389
f6f4ad9
 
 
 
 
b378e61
 
 
 
 
 
 
 
 
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
import gradio as gr
import pandas as pd
import numpy as np
from datetime import datetime
import plotly.graph_objects as go
import re
from urllib.parse import urlparse
import requests
import json
import os

class StartupValuationCalculator:
    def __init__(self):
        # 업쒅별 벀치마크 λ©€ν‹°ν”Œ (EV/ARR)
        self.industry_multiples = {
            "SaaS - B2B": {"low": 3, "mid": 6, "high": 10},
            "SaaS - B2C": {"low": 2, "mid": 4, "high": 7},
            "λ§ˆμΌ“ν”Œλ ˆμ΄μŠ€": {"low": 2, "mid": 5, "high": 8},
            "이컀머슀": {"low": 1, "mid": 2.5, "high": 4},
            "ν•€ν…Œν¬": {"low": 3, "mid": 5, "high": 8},
            "ν—¬μŠ€μΌ€μ–΄": {"low": 4, "mid": 7, "high": 12},
            "AI/λ”₯ν…Œν¬": {"low": 5, "mid": 8, "high": 15},
            "기타": {"low": 2, "mid": 4, "high": 6}
        }
        
        # μ„±μž₯λ₯  μ‘°μ • κ³„μˆ˜
        self.growth_adjustments = {
            "0-20%": 0.7,
            "20-50%": 0.9,
            "50-100%": 1.1,
            "100-200%": 1.3,
            "200%+": 1.5
        }
        
        # λ²„ν¬μŠ€ 방법 μΉ΄ν…Œκ³ λ¦¬λ³„ μ΅œλŒ€κ°’ ($500K each)
        self.berkus_max_values = {
            "sound_idea": 500000,
            "prototype": 500000,
            "quality_team": 500000,
            "strategic_relationships": 500000,
            "product_rollout": 500000
        }
        
        # μŠ€μ½”μ–΄μΉ΄λ“œ κ°€μ€‘μΉ˜
        self.scorecard_weights = {
            "team": 0.30,
            "market_size": 0.25,
            "product": 0.15,
            "competition": 0.10,
            "marketing": 0.10,
            "need_for_funding": 0.05,
            "other": 0.05
        }
        
        # 언어별 ν…μŠ€νŠΈ
        self.translations = {
            "ko": {
                "title": "πŸ¦„ μŠ€νƒ€νŠΈμ—… κ°€μΉ˜ν‰κ°€ μžλ™ν™” μ‹œμŠ€ν…œ v3.0",
                "subtitle": "λ²„ν¬μŠ€ 방법과 μŠ€μ½”μ–΄μΉ΄λ“œ 방법을 ν¬ν•¨ν•œ μ’…ν•© 평가",
                "valuation_result": "κ°€μΉ˜ν‰κ°€ κ²°κ³Ό",
                "company_value": "κΈ°μ—…κ°€μΉ˜",
                "arr": "μ—°κ°„ 반볡 맀좜",
                "multiple": "적용 λ©€ν‹°ν”Œ",
                "unit_economics": "λ‹¨μœ„κ²½μ œ",
                "berkus_score": "λ²„ν¬μŠ€ 평가",
                "scorecard_score": "μŠ€μ½”μ–΄μΉ΄λ“œ 평가",
                "financial_health": "재무 건전성",
                "insights": "평가 μΈμ‚¬μ΄νŠΈ"
            },
            "en": {
                "title": "πŸ¦„ Startup Valuation System v3.0",
                "subtitle": "Comprehensive valuation with Berkus and Scorecard methods",
                "valuation_result": "Valuation Result",
                "company_value": "Company Value",
                "arr": "Annual Recurring Revenue",
                "multiple": "Applied Multiple",
                "unit_economics": "Unit Economics",
                "berkus_score": "Berkus Score",
                "scorecard_score": "Scorecard Score",
                "financial_health": "Financial Health",
                "insights": "Valuation Insights"
            }
        }
    
    def call_llm_api(self, prompt, api_key):
        """LLM APIλ₯Ό ν˜ΈμΆœν•˜μ—¬ κ³ κΈ‰ 뢄석 μˆ˜ν–‰"""
        if not api_key:
            return None
            
        url = "https://api.fireworks.ai/inference/v1/chat/completions"
        
        payload = {
            "model": "accounts/fireworks/models/qwen3-235b-a22b-instruct-2507",
            "max_tokens": 4096,
            "top_p": 1,
            "top_k": 40,
            "presence_penalty": 0,
            "frequency_penalty": 0,
            "temperature": 0.6,
            "messages": [
                {
                    "role": "system",
                    "content": "You are an expert startup valuation analyst and strategic advisor with deep knowledge of venture capital, financial analysis, and business strategy."
                },
                {
                    "role": "user",
                    "content": prompt
                }
            ]
        }
        
        headers = {
            "Accept": "application/json",
            "Content-Type": "application/json",
            "Authorization": f"Bearer {api_key}"
        }
        
        try:
            response = requests.post(url, headers=headers, data=json.dumps(payload))
            if response.status_code == 200:
                return response.json()['choices'][0]['message']['content']
            else:
                return None
        except:
            return None
    
    def generate_strategic_report(self, data, results, language, api_key):
        """LLM을 μ‚¬μš©ν•˜μ—¬ μ „λž΅μ  λ³΄κ³ μ„œ 생성"""
        
        if language == "ko":
            prompt = f"""
λ‹€μŒ μŠ€νƒ€νŠΈμ—…μ˜ κ°€μΉ˜ν‰κ°€ κ²°κ³Όλ₯Ό λΆ„μ„ν•˜κ³  μ „λž΅μ  쑰언을 ν¬ν•¨ν•œ 상세 λ³΄κ³ μ„œλ₯Ό μž‘μ„±ν•΄μ£Όμ„Έμš”:

νšŒμ‚¬ 정보:
- νšŒμ‚¬λͺ…: {data['company_name']}
- 섀립년도: {data['founded_year']}
- μ‚°μ—…: {data['industry']}
- 사업 단계: {data['stage']}

평가 κ²°κ³Ό:
- μ΅œμ’… κΈ°μ—…κ°€μΉ˜: ${results['final_valuation']/1000000:.2f}M
- λ²„ν¬μŠ€ 평가: ${results['berkus_valuation']/1000000:.2f}M
- ARR: ${results['arr']/1000000:.2f}M
- μ„±μž₯λ₯ : {data['growth_rate']}%
- LTV/CAC: {results['ltv_cac_ratio']:.1f}
- λŸ°μ›¨μ΄: {results['runway']:.1f}κ°œμ›”
- μŠ€μ½”μ–΄μΉ΄λ“œ μ μˆ˜λ“€: {results['scorecard_adjustments']}

λ‹€μŒμ„ ν¬ν•¨ν•˜μ—¬ μž‘μ„±ν•΄μ£Όμ„Έμš”:
1. κ°€μΉ˜ν‰κ°€ 결과의 타당성 뢄석
2. 동쒅업계 λŒ€λΉ„ 포지셔닝
3. μ£Όμš” 강점과 κ°œμ„  ν•„μš” μ˜μ—­
4. ν–₯ν›„ 6-12κ°œμ›” μ „λž΅μ  μš°μ„ μˆœμœ„
5. μžκΈˆμ‘°λ‹¬ μ „λž΅ 및 적정 쑰달 규λͺ¨
6. μ£Όμš” λ¦¬μŠ€ν¬μ™€ μ™„ν™” λ°©μ•ˆ
7. 핡심 KPI와 λ§ˆμΌμŠ€ν†€ μ œμ•ˆ
"""
        else:
            prompt = f"""
Please analyze the following startup valuation results and provide a comprehensive strategic report:

Company Information:
- Company Name: {data['company_name']}
- Founded: {data['founded_year']}
- Industry: {data['industry']}
- Stage: {data['stage']}

Valuation Results:
- Final Valuation: ${results['final_valuation']/1000000:.2f}M
- Berkus Valuation: ${results['berkus_valuation']/1000000:.2f}M
- ARR: ${results['arr']/1000000:.2f}M
- Growth Rate: {data['growth_rate']}%
- LTV/CAC: {results['ltv_cac_ratio']:.1f}
- Runway: {results['runway']:.1f} months
- Scorecard Scores: {results['scorecard_adjustments']}

Please include:
1. Valuation validity analysis
2. Industry positioning
3. Key strengths and improvement areas
4. Strategic priorities for next 6-12 months
5. Fundraising strategy and optimal round size
6. Key risks and mitigation strategies
7. Core KPIs and milestone recommendations
"""
        
        llm_response = self.call_llm_api(prompt, api_key)
        return llm_response
    
    def calculate_berkus_score(self, berkus_data):
        """λ²„ν¬μŠ€ λ°©λ²•μœΌλ‘œ 평가 (μ΅œλŒ€ $2.5M)"""
        scores = {}
        total = 0
        
        # 1. κ±΄μ „ν•œ 아이디어 (Sound Idea)
        idea_score = min(100, berkus_data["idea_validation"] + berkus_data["market_research"] * 10)
        scores["sound_idea"] = self.berkus_max_values["sound_idea"] * (idea_score / 100)
        
        # 2. ν”„λ‘œν† νƒ€μž… (Prototype)
        prototype_score = 0
        if berkus_data["prototype_stage"] == "μ—†μŒ":
            prototype_score = 0
        elif berkus_data["prototype_stage"] == "컨셉/λͺ©μ—…":
            prototype_score = 30
        elif berkus_data["prototype_stage"] == "μž‘λ™ ν”„λ‘œν† νƒ€μž…":
            prototype_score = 60
        elif berkus_data["prototype_stage"] == "베타 버전":
            prototype_score = 80
        elif berkus_data["prototype_stage"] == "μΆœμ‹œ 버전":
            prototype_score = 100
        scores["prototype"] = self.berkus_max_values["prototype"] * (prototype_score / 100)
        
        # 3. μš°μˆ˜ν•œ νŒ€ (Quality Team)
        team_score = min(100, 
            min(berkus_data["team_experience"], 10) * 10 +  # μ΅œλŒ€ 10λ…„κΉŒμ§€λ§Œ κ°€μ‚°
            berkus_data["domain_expertise"] * 15 +
            berkus_data["startup_experience"] * 15
        )
        scores["quality_team"] = self.berkus_max_values["quality_team"] * (team_score / 100)
        
        # 4. μ „λž΅μ  관계 (Strategic Relationships)
        relationship_score = min(100,
            berkus_data["partnerships"] * 15 +
            berkus_data["advisors"] * 10 +
            berkus_data["pilot_customers"] * 25
        )
        scores["strategic_relationships"] = self.berkus_max_values["strategic_relationships"] * (relationship_score / 100)
        
        # 5. μ œν’ˆ μΆœμ‹œ/판맀 (Product Rollout)
        if berkus_data["sales_started"]:
            rollout_score = min(100, 50 + berkus_data["customer_validation"] * 10)
        else:
            rollout_score = berkus_data["launch_readiness"]
        scores["product_rollout"] = self.berkus_max_values["product_rollout"] * (rollout_score / 100)
        
        total = sum(scores.values())
        return total, scores
    
    def calculate_scorecard_valuation(self, scorecard_data, base_valuation):
        """μŠ€μ½”μ–΄μΉ΄λ“œ λ°©λ²•μœΌλ‘œ μ‘°μ •λœ κ°€μΉ˜ν‰κ°€"""
        adjustments = {}
        
        # 각 μš”μ†Œλ³„ μ‘°μ • λΉ„μœ¨ 계산 (0.5 ~ 1.5)
        adjustments["team"] = scorecard_data["team_strength"] / 100
        adjustments["market_size"] = scorecard_data["market_opportunity"] / 100
        adjustments["product"] = scorecard_data["product_stage"] / 100
        adjustments["competition"] = scorecard_data["competitive_advantage"] / 100
        adjustments["marketing"] = scorecard_data["marketing_channels"] / 100
        adjustments["need_for_funding"] = scorecard_data["funding_efficiency"] / 100
        adjustments["other"] = scorecard_data["other_factors"] / 100
        
        # 가쀑 평균 계산
        weighted_score = 0
        for factor, weight in self.scorecard_weights.items():
            # 각 점수λ₯Ό 0.5 ~ 1.5 λ²”μœ„λ‘œ λ³€ν™˜ (50점이 1.0)
            adjusted_score = 0.5 + (adjustments[factor])
            weighted_score += adjusted_score * weight
        
        # κΈ°λ³Έ κ°€μΉ˜ν‰κ°€μ— μ‘°μ • λΉ„μœ¨ 적용
        adjusted_valuation = base_valuation * weighted_score
        
        return adjusted_valuation, adjustments, weighted_score
    
    def calculate_arr(self, monthly_revenue, revenue_type):
        """μ›” λ§€μΆœμ„ μ—°κ°„ 반볡 맀좜(ARR)둜 λ³€ν™˜"""
        if revenue_type == "κ΅¬λ…ν˜• (SaaS)":
            return monthly_revenue * 12
        elif revenue_type == "κ±°λž˜μˆ˜μˆ˜λ£Œν˜•":
            return monthly_revenue * 12 * 0.8
        else:
            return monthly_revenue * 12 * 0.6
    
    def calculate_ltv(self, arpu, gross_margin, monthly_churn):
        """LTV 계산"""
        if monthly_churn == 0:
            monthly_churn = 0.01
        return arpu * (gross_margin / 100) / monthly_churn
    
    def calculate_cac(self, monthly_marketing, monthly_sales, new_customers):
        """CAC 계산"""
        if new_customers == 0:
            return 0
        return (monthly_marketing + monthly_sales) / new_customers
    
    def calculate_payback(self, cac, arpu, gross_margin):
        """Payback Period 계산 (κ°œμ›”)"""
        if arpu * (gross_margin / 100) == 0:
            return 999
        return cac / (arpu * (gross_margin / 100))
    
    def calculate_valuation(self, data, berkus_data, scorecard_data, use_revenue_multiple=True):
        """μ’…ν•© κ°€μΉ˜ν‰κ°€ 계산"""
        results = {}
        
        # 1. λ²„ν¬μŠ€ 방법 평가
        berkus_valuation, berkus_scores = self.calculate_berkus_score(berkus_data)
        results["berkus_valuation"] = berkus_valuation
        results["berkus_scores"] = berkus_scores
        
        # 2. 맀좜 기반 평가 (맀좜이 μžˆλŠ” 경우)
        if data["monthly_revenue"] > 0 and use_revenue_multiple:
            # ARR 계산
            arr = self.calculate_arr(data["monthly_revenue"], data["revenue_type"])
            
            # λ‹¨μœ„κ²½μ œ 계산
            ltv = self.calculate_ltv(data["arpu"], data["gross_margin"], data["monthly_churn"])
            cac = self.calculate_cac(data["monthly_marketing"], data["monthly_sales"], data["new_customers"])
            ltv_cac_ratio = ltv / cac if cac > 0 else 0
            payback = self.calculate_payback(cac, data["arpu"], data["gross_margin"])
            
            # λ©€ν‹°ν”Œ κ²°μ •
            multiples = self.industry_multiples[data["industry"]]
            growth_category = self.get_growth_category(data["growth_rate"])
            growth_adj = self.growth_adjustments[growth_category]
            
            # κΈ°λ³Έ λ©€ν‹°ν”Œ 선택
            if ltv_cac_ratio >= 3:
                base_multiple = multiples["high"]
            elif ltv_cac_ratio >= 1.5:
                base_multiple = multiples["mid"]
            else:
                base_multiple = multiples["low"]
            
            adjusted_multiple = base_multiple * growth_adj
            
            # 맀좜 기반 κ°€μΉ˜ν‰κ°€
            revenue_valuation = arr * adjusted_multiple
            
            results["arr"] = arr
            results["ltv"] = ltv
            results["cac"] = cac
            results["ltv_cac_ratio"] = ltv_cac_ratio
            results["payback"] = payback
            results["multiple"] = adjusted_multiple
        else:
            revenue_valuation = 0
            results["arr"] = 0
            results["ltv"] = 0
            results["cac"] = 0
            results["ltv_cac_ratio"] = 0
            results["payback"] = 0
            results["multiple"] = 0
        
        # 3. κΈ°λ³Έ κ°€μΉ˜ν‰κ°€ κ²°μ • (λ²„ν¬μŠ€ vs 맀좜 기반)
        if revenue_valuation > berkus_valuation * 1.5:
            base_valuation = revenue_valuation
            valuation_method = "revenue_multiple"
        else:
            base_valuation = max(berkus_valuation, revenue_valuation)
            valuation_method = "berkus"
        
        # 4. μŠ€μ½”μ–΄μΉ΄λ“œ μ‘°μ •
        final_valuation, scorecard_adjustments, weighted_score = self.calculate_scorecard_valuation(
            scorecard_data, base_valuation
        )
        
        results["base_valuation"] = base_valuation
        results["final_valuation"] = final_valuation
        results["valuation_method"] = valuation_method
        results["scorecard_adjustments"] = scorecard_adjustments
        results["scorecard_multiplier"] = weighted_score
        
        # 5. λŸ°μ›¨μ΄ 계산
        results["runway"] = data["cash_balance"] / data["burn_rate"] if data["burn_rate"] > 0 else 999
        
        return results
    
    def get_growth_category(self, growth_rate):
        """μ„±μž₯λ₯  μΉ΄ν…Œκ³ λ¦¬ κ²°μ •"""
        if growth_rate < 20:
            return "0-20%"
        elif growth_rate < 50:
            return "20-50%"
        elif growth_rate < 100:
            return "50-100%"
        elif growth_rate < 200:
            return "100-200%"
        else:
            return "200%+"
    
    def create_valuation_comparison_chart(self, results, language="ko"):
        """평가 방법별 비ꡐ 차트"""
        fig = go.Figure()
        
        methods = ["Berkus", "Revenue Multiple", "Scorecard Adjusted"]
        values = [
            results["berkus_valuation"],
            results["base_valuation"] if results["valuation_method"] == "revenue_multiple" else 0,
            results["final_valuation"]
        ]
        
        fig.add_trace(go.Bar(
            x=methods,
            y=values,
            text=[f"${v/1000000:.2f}M" for v in values],
            textposition="outside",
            marker_color=["lightblue", "lightgreen", "darkblue"]
        ))
        
        title = "평가 방법별 κΈ°μ—…κ°€μΉ˜ 비ꡐ" if language == "ko" else "Valuation by Method"
        fig.update_layout(
            title=title,
            yaxis_title="Valuation (USD)",
            showlegend=False,
            height=400
        )
        
        return fig
    
    def create_scorecard_radar_chart(self, adjustments, language="ko"):
        """μŠ€μ½”μ–΄μΉ΄λ“œ μš”μ†Œλ³„ 점수 λ ˆμ΄λ” 차트"""
        categories = list(adjustments.keys())
        if language == "ko":
            categories_display = ["νŒ€", "μ‹œμž₯규λͺ¨", "μ œν’ˆ", "경쟁λ ₯", "λ§ˆμΌ€νŒ…", "자금효율", "기타"]
        else:
            categories_display = ["Team", "Market", "Product", "Competition", "Marketing", "Funding", "Other"]
        
        values = [adjustments[cat] * 100 for cat in categories]
        
        fig = go.Figure(data=go.Scatterpolar(
            r=values,
            theta=categories_display,
            fill='toself'
        ))
        
        title = "μŠ€μ½”μ–΄μΉ΄λ“œ 평가 μš”μ†Œ" if language == "ko" else "Scorecard Factors"
        fig.update_layout(
            polar=dict(
                radialaxis=dict(
                    visible=True,
                    range=[0, 100]
                )),
            showlegend=False,
            title=title
        )
        
        return fig

def create_ui():
    calculator = StartupValuationCalculator()
    
    def process_valuation(
        api_key, language,
        # κΈ°λ³Έ 정보
        company_name, founded_year, industry, stage, revenue_type,
        # 맀좜 정보
        monthly_revenue, growth_rate, arpu, gross_margin, monthly_churn,
        retention_rate, new_customers, monthly_marketing, monthly_sales,
        # 재무 정보
        cash_balance, burn_rate,
        # λ²„ν¬μŠ€ 방법 μž…λ ₯
        idea_validation, market_research, prototype_stage, team_experience,
        domain_expertise, startup_experience, partnerships, advisors,
        pilot_customers, sales_started, customer_validation, launch_readiness,
        # μŠ€μ½”μ–΄μΉ΄λ“œ μž…λ ₯
        team_strength, market_opportunity, product_stage, competitive_advantage,
        marketing_channels, funding_efficiency, other_factors
    ):
        # 데이터 μ€€λΉ„
        data = {
            "company_name": company_name,
            "founded_year": founded_year,
            "industry": industry,
            "stage": stage,
            "revenue_type": revenue_type,
            "monthly_revenue": monthly_revenue * 1000,
            "growth_rate": growth_rate,
            "arpu": arpu,
            "gross_margin": gross_margin,
            "monthly_churn": monthly_churn / 100,
            "retention_rate": retention_rate,
            "new_customers": new_customers,
            "monthly_marketing": monthly_marketing * 1000,
            "monthly_sales": monthly_sales * 1000,
            "cash_balance": cash_balance * 1000,
            "burn_rate": burn_rate * 1000
        }
        
        berkus_data = {
            "idea_validation": idea_validation,
            "market_research": market_research,
            "prototype_stage": prototype_stage,
            "team_experience": team_experience,
            "domain_expertise": domain_expertise,
            "startup_experience": startup_experience,
            "partnerships": partnerships,
            "advisors": advisors,
            "pilot_customers": pilot_customers,
            "sales_started": sales_started,
            "customer_validation": customer_validation,
            "launch_readiness": launch_readiness
        }
        
        scorecard_data = {
            "team_strength": team_strength,
            "market_opportunity": market_opportunity,
            "product_stage": product_stage,
            "competitive_advantage": competitive_advantage,
            "marketing_channels": marketing_channels,
            "funding_efficiency": funding_efficiency,
            "other_factors": other_factors
        }
        
        # κ°€μΉ˜ν‰κ°€ 계산
        use_revenue = monthly_revenue > 0
        results = calculator.calculate_valuation(data, berkus_data, scorecard_data, use_revenue)
        
        # 언어별 ν…μŠ€νŠΈ
        t = calculator.translations[language]
        
        # κ²°κ³Ό ν¬λ§·νŒ…
        if language == "ko":
            valuation_text = f"""
# πŸš€ {company_name} {t['valuation_result']}

## πŸ“Š μ’…ν•© 평가
- **{t['company_value']}**: ${results['final_valuation']/1000000:.2f}M
- **평가 방법**: {'맀좜 λ©€ν‹°ν”Œ' if results['valuation_method'] == 'revenue_multiple' else 'λ²„ν¬μŠ€ 방법'} + μŠ€μ½”μ–΄μΉ΄λ“œ μ‘°μ •
- **μŠ€μ½”μ–΄μΉ΄λ“œ μ‘°μ • 배수**: {results['scorecard_multiplier']:.2f}x

## 🎯 {t['berkus_score']} (μ΅œλŒ€ $2.5M)
- **총 평가앑**: ${results['berkus_valuation']/1000000:.2f}M
- κ±΄μ „ν•œ 아이디어: ${results['berkus_scores']['sound_idea']/1000:.0f}K
- ν”„λ‘œν† νƒ€μž…: ${results['berkus_scores']['prototype']/1000:.0f}K
- μš°μˆ˜ν•œ νŒ€: ${results['berkus_scores']['quality_team']/1000:.0f}K
- μ „λž΅μ  관계: ${results['berkus_scores']['strategic_relationships']/1000:.0f}K
- μ œν’ˆ μΆœμ‹œ: ${results['berkus_scores']['product_rollout']/1000:.0f}K
"""
        else:
            valuation_text = f"""
# πŸš€ {company_name} {t['valuation_result']}

## πŸ“Š Summary
- **{t['company_value']}**: ${results['final_valuation']/1000000:.2f}M
- **Method**: {'Revenue Multiple' if results['valuation_method'] == 'revenue_multiple' else 'Berkus Method'} + Scorecard
- **Scorecard Multiplier**: {results['scorecard_multiplier']:.2f}x

## 🎯 {t['berkus_score']} (Max $2.5M)
- **Total**: ${results['berkus_valuation']/1000000:.2f}M
- Sound Idea: ${results['berkus_scores']['sound_idea']/1000:.0f}K
- Prototype: ${results['berkus_scores']['prototype']/1000:.0f}K
- Quality Team: ${results['berkus_scores']['quality_team']/1000:.0f}K
- Strategic Relationships: ${results['berkus_scores']['strategic_relationships']/1000:.0f}K
- Product Rollout: ${results['berkus_scores']['product_rollout']/1000:.0f}K
"""
        
        # 맀좜 기반 평가 μΆ”κ°€ (맀좜이 μžˆλŠ” 경우)
        if use_revenue and results['arr'] > 0:
            if language == "ko":
                valuation_text += f"""
## πŸ’° 맀좜 기반 평가
- **ARR**: ${results['arr']/1000000:.2f}M
- **적용 λ©€ν‹°ν”Œ**: {results['multiple']:.1f}x
- **LTV/CAC**: {results['ltv_cac_ratio']:.1f}x
- **Payback**: {results['payback']:.1f}κ°œμ›”
"""
            else:
                valuation_text += f"""
## πŸ’° Revenue-based Valuation
- **ARR**: ${results['arr']/1000000:.2f}M
- **Multiple**: {results['multiple']:.1f}x
- **LTV/CAC**: {results['ltv_cac_ratio']:.1f}x
- **Payback**: {results['payback']:.1f} months
"""
        
        # 재무 건전성
        if language == "ko":
            valuation_text += f"""
## πŸƒ {t['financial_health']}
- **ν˜„κΈˆ λŸ°μ›¨μ΄**: {results['runway']:.1f}κ°œμ›”
- **μ›”κ°„ 번레이트**: ${burn_rate}K
"""
        else:
            valuation_text += f"""
## πŸƒ {t['financial_health']}
- **Cash Runway**: {results['runway']:.1f} months
- **Monthly Burn Rate**: ${burn_rate}K
"""
        
        # LLM 기반 μ „λž΅μ  뢄석 μΆ”κ°€
        strategic_report = None
        if api_key and api_key.strip():
            strategic_report = calculator.generate_strategic_report(data, results, language, api_key)
            
            if strategic_report:
                if language == "ko":
                    valuation_text += f"""
## πŸ€– AI μ „λž΅μ  뢄석

{strategic_report}
"""
                else:
                    valuation_text += f"""
## πŸ€– AI Strategic Analysis

{strategic_report}
"""
        
        # 차트 생성
        comparison_chart = calculator.create_valuation_comparison_chart(results, language)
        scorecard_chart = calculator.create_scorecard_radar_chart(results['scorecard_adjustments'], language)
        
        # 상세 ν…Œμ΄λΈ”
        if language == "ko":
            methods_df = pd.DataFrame({
                "평가 방법": ["λ²„ν¬μŠ€ 방법", "맀좜 λ©€ν‹°ν”Œ", "μŠ€μ½”μ–΄μΉ΄λ“œ μ‘°μ •", "μ΅œμ’… 평가"],
                "평가앑": [
                    f"${results['berkus_valuation']/1000000:.2f}M",
                    f"${results['base_valuation']/1000000:.2f}M" if results['valuation_method'] == 'revenue_multiple' else "N/A",
                    f"{results['scorecard_multiplier']:.2f}x",
                    f"${results['final_valuation']/1000000:.2f}M"
                ]
            })
        else:
            methods_df = pd.DataFrame({
                "Method": ["Berkus Method", "Revenue Multiple", "Scorecard Adjustment", "Final Valuation"],
                "Value": [
                    f"${results['berkus_valuation']/1000000:.2f}M",
                    f"${results['base_valuation']/1000000:.2f}M" if results['valuation_method'] == 'revenue_multiple' else "N/A",
                    f"{results['scorecard_multiplier']:.2f}x",
                    f"${results['final_valuation']/1000000:.2f}M"
                ]
            })
        
        return valuation_text, comparison_chart, scorecard_chart, methods_df
    
    # Gradio UI
    with gr.Blocks(title="Startup Valuation Calculator", theme=gr.themes.Soft()) as demo:
        gr.Markdown("""
        # πŸ¦„ μŠ€νƒ€νŠΈμ—… κ°€μΉ˜ν‰κ°€ μžλ™ν™” μ‹œμŠ€ν…œ v3.5
        ### AI 기반 μ „λž΅μ  뢄석을 ν¬ν•¨ν•œ μ’…ν•© 평가 μ‹œμŠ€ν…œ
        """)
        
        # API 킀와 μ–Έμ–΄ 선택
        with gr.Row():
            api_key = gr.Textbox(
                label="Fireworks API Key (선택사항 - AI λΆ„μ„μš©)",
                placeholder="AI μ „λž΅μ  뢄석을 μ›ν•˜μ‹œλ©΄ API ν‚€λ₯Ό μž…λ ₯ν•˜μ„Έμš”",
                type="password"
            )
            language = gr.Radio(
                choices=[("ν•œκ΅­μ–΄", "ko"), ("English", "en")],
                value="ko",
                label="Language / μ–Έμ–΄",
                type="value"
            )
        
        with gr.Tab("κΈ°λ³Έ 정보 / Basic Info"):
            with gr.Row():
                company_name = gr.Textbox(label="νšŒμ‚¬λͺ… / Company Name", value="우리 μŠ€νƒ€νŠΈμ—…")
                founded_year = gr.Slider(2000, 2025, value=2022, step=1, label="섀립연도 / Founded Year")
            
            with gr.Row():
                industry = gr.Dropdown(
                    choices=list(calculator.industry_multiples.keys()),
                    value="SaaS - B2B",
                    label="μ‚°μ—… λΆ„λ₯˜ / Industry"
                )
                stage = gr.Radio(
                    choices=["MVP/베타", "초기 맀좜", "μ„±μž₯ 단계", "μˆ˜μ΅μ„± 확보"],
                    value="초기 맀좜",
                    label="사업 단계 / Stage"
                )
            
            revenue_type = gr.Radio(
                choices=["κ΅¬λ…ν˜• (SaaS)", "κ±°λž˜μˆ˜μˆ˜λ£Œν˜•", "μΌνšŒμ„± 판맀"],
                value="κ΅¬λ…ν˜• (SaaS)",
                label="수읡 λͺ¨λΈ / Revenue Model"
            )
        
        with gr.Tab("λ²„ν¬μŠ€ 평가 / Berkus Method"):
            gr.Markdown("### πŸ’‘ 아이디어 검증 / Idea Validation")
            with gr.Row():
                idea_validation = gr.Slider(0, 100, value=70, step=10,
                                          label="아이디어 검증 μˆ˜μ€€ / Idea Validation Level (%)")
                market_research = gr.Slider(0, 10, value=5, step=1,
                                          label="μ‹œμž₯ 쑰사 깊이 / Market Research Depth (1-10)")
            
            gr.Markdown("### πŸ”§ ν”„λ‘œν† νƒ€μž… / Prototype")
            prototype_stage = gr.Radio(
                choices=["μ—†μŒ", "컨셉/λͺ©μ—…", "μž‘λ™ ν”„λ‘œν† νƒ€μž…", "베타 버전", "μΆœμ‹œ 버전"],
                value="베타 버전",
                label="ν”„λ‘œν† νƒ€μž… 단계 / Prototype Stage"
            )
            
            gr.Markdown("### πŸ‘₯ νŒ€ μ—­λŸ‰ / Team Quality")
            with gr.Row():
                team_experience = gr.Slider(0, 30, value=5, step=1,
                                          label="νŒ€ 평균 κ²½λ ₯(λ…„) / Average Experience (years)")
                domain_expertise = gr.Slider(0, 5, value=3, step=1,
                                           label="도메인 μ „λ¬Έμ„± / Domain Expertise (1-5)")
                startup_experience = gr.Slider(0, 5, value=2, step=1,
                                             label="μŠ€νƒ€νŠΈμ—… κ²½ν—˜ / Startup Experience (1-5)")
            
            gr.Markdown("### 🀝 μ „λž΅μ  관계 / Strategic Relationships")
            with gr.Row():
                partnerships = gr.Number(label="μ „λž΅μ  νŒŒνŠΈλ„ˆμ‹­ 수 / Strategic Partnerships", value=2)
                advisors = gr.Number(label="κ³ λ¬Έ/λ©˜ν†  수 / Advisors/Mentors", value=3)
                pilot_customers = gr.Number(label="파일럿 고객 수 / Pilot Customers", value=5)
            
            gr.Markdown("### πŸš€ μ œν’ˆ μΆœμ‹œ / Product Rollout")
            with gr.Row():
                sales_started = gr.Checkbox(label="맀좜 λ°œμƒ μ‹œμž‘ / Sales Started", value=True)
                customer_validation = gr.Slider(0, 10, value=5, step=1,
                                              label="고객 검증 μˆ˜μ€€ / Customer Validation (1-10)")
                launch_readiness = gr.Slider(0, 100, value=80, step=10,
                                           label="μΆœμ‹œ 쀀비도 / Launch Readiness (%)")
        
        with gr.Tab("μŠ€μ½”μ–΄μΉ΄λ“œ 평가 / Scorecard"):
            gr.Markdown("### 각 μš”μ†Œλ₯Ό 동일 μŠ€ν…Œμ΄μ§€ 평균 λŒ€λΉ„ 평가 (50 = 평균)")
            gr.Markdown("### Rate each factor compared to same-stage average (50 = average)")
            
            team_strength = gr.Slider(0, 100, value=60, step=5,
                                    label="νŒ€ μ—­λŸ‰ / Team Strength")
            market_opportunity = gr.Slider(0, 100, value=70, step=5,
                                         label="μ‹œμž₯ 기회 / Market Opportunity")
            product_stage = gr.Slider(0, 100, value=65, step=5,
                                    label="μ œν’ˆ 완성도 / Product Maturity")
            competitive_advantage = gr.Slider(0, 100, value=55, step=5,
                                            label="경쟁 μš°μœ„ / Competitive Advantage")
            marketing_channels = gr.Slider(0, 100, value=50, step=5,
                                         label="λ§ˆμΌ€νŒ…/판맀 / Marketing & Sales")
            funding_efficiency = gr.Slider(0, 100, value=60, step=5,
                                         label="자금 νš¨μœ¨μ„± / Funding Efficiency")
            other_factors = gr.Slider(0, 100, value=50, step=5,
                                    label="기타 μš”μ†Œ / Other Factors")
        
        with gr.Tab("맀좜 정보 / Revenue (Optional)"):
            gr.Markdown("### πŸ’° 맀좜이 μžˆλŠ” 경우만 μž…λ ₯ / Only if you have revenue")
            with gr.Row():
                monthly_revenue = gr.Number(label="μ›” 맀좜 / Monthly Revenue ($K)", value=0)
                growth_rate = gr.Slider(0, 300, value=0, step=10,
                                       label="μ—°κ°„ μ„±μž₯λ₯  / Annual Growth Rate (%)")
            
            with gr.Row():
                arpu = gr.Number(label="ARPU ($)", value=0)
                gross_margin = gr.Slider(0, 100, value=0, step=5,
                                        label="맀좜총이읡λ₯  / Gross Margin (%)")
            
            with gr.Row():
                retention_rate = gr.Slider(0, 100, value=0, step=5,
                                          label="고객 μœ μ§€μœ¨ / Retention Rate (%)")
                monthly_churn = gr.Slider(0, 20, value=0, step=0.5,
                                         label="μ›” μ΄νƒˆλ₯  / Monthly Churn (%)")
            
            with gr.Row():
                new_customers = gr.Number(label="μ›” μ‹ κ·œ 고객 / New Customers/Month", value=0)
                monthly_marketing = gr.Number(label="μ›” λ§ˆμΌ€νŒ… λΉ„μš© / Marketing Cost ($K)", value=0)
                monthly_sales = gr.Number(label="μ›” μ˜μ—… λΉ„μš© / Sales Cost ($K)", value=0)
        
        with gr.Tab("재무 ν˜„ν™© / Financials"):
            gr.Markdown("### πŸ’Έ ν˜„κΈˆ 상황 / Cash Position ($K)")
            with gr.Row():
                cash_balance = gr.Number(label="ν˜„κΈˆ μž”κ³  / Cash Balance ($K)", value=1000)
                burn_rate = gr.Number(label="μ›” 번레이트 / Monthly Burn Rate ($K)", value=80)
        
        # 평가 μ‹€ν–‰ λ²„νŠΌ
        evaluate_btn = gr.Button("πŸ” κ°€μΉ˜ν‰κ°€ μ‹€ν–‰ / Run Valuation", variant="primary", size="lg")
        
        # κ²°κ³Ό 좜λ ₯
        with gr.Row():
            with gr.Column(scale=2):
                valuation_output = gr.Markdown(label="평가 κ²°κ³Ό / Results")
            with gr.Column(scale=1):
                methods_table = gr.DataFrame(label="평가 방법 비ꡐ / Method Comparison")
        
        with gr.Row():
            comparison_chart = gr.Plot(label="평가 방법 비ꡐ / Valuation Comparison")
            scorecard_chart = gr.Plot(label="μŠ€μ½”μ–΄μΉ΄λ“œ 뢄석 / Scorecard Analysis")
        
        # 이벀트 μ—°κ²°
        evaluate_btn.click(
            process_valuation,
            inputs=[
                api_key, language,
                company_name, founded_year, industry, stage, revenue_type,
                monthly_revenue, growth_rate, arpu, gross_margin, monthly_churn,
                retention_rate, new_customers, monthly_marketing, monthly_sales,
                cash_balance, burn_rate,
                idea_validation, market_research, prototype_stage, team_experience,
                domain_expertise, startup_experience, partnerships, advisors,
                pilot_customers, sales_started, customer_validation, launch_readiness,
                team_strength, market_opportunity, product_stage, competitive_advantage,
                marketing_channels, funding_efficiency, other_factors
            ],
            outputs=[valuation_output, comparison_chart, scorecard_chart, methods_table]
        )
        
        # μ˜ˆμ‹œ 데이터
        gr.Markdown("### πŸ“ μ˜ˆμ‹œ 데이터 / Example Data")
        with gr.Row():
            gr.Button("초기 μŠ€νƒ€νŠΈμ—… / Early Startup").click(
                lambda: [
                    "", "ko", "ν…Œν¬ μŠ€νƒ€νŠΈμ—…", 2023, "AI/λ”₯ν…Œν¬", "MVP/베타", "κ΅¬λ…ν˜• (SaaS)",
                    0, 0, 0, 0, 0, 0, 0, 0, 0, 500, 50,
                    80, 7, "베타 버전", 3, 4, 1, 1, 2, 3, False, 0, 70,
                    70, 65, 55, 60, 45, 50, 50
                ],
                outputs=[
                    api_key, language, company_name, founded_year, industry, stage, revenue_type,
                    monthly_revenue, growth_rate, arpu, gross_margin, monthly_churn,
                    retention_rate, new_customers, monthly_marketing, monthly_sales,
                    cash_balance, burn_rate,
                    idea_validation, market_research, prototype_stage, team_experience,
                    domain_expertise, startup_experience, partnerships, advisors,
                    pilot_customers, sales_started, customer_validation, launch_readiness,
                    team_strength, market_opportunity, product_stage, competitive_advantage,
                    marketing_channels, funding_efficiency, other_factors
                ]
            )
            
            gr.Button("μ„±μž₯ 단계 / Growth Stage").click(
                lambda: [
                    "", "en", "SaaS Corp", 2021, "SaaS - B2B", "μ„±μž₯ 단계", "κ΅¬λ…ν˜• (SaaS)",
                    100, 150, 200, 75, 2, 90, 40, 30, 20, 2000, 120,
                    90, 9, "μΆœμ‹œ 버전", 8, 5, 3, 5, 5, 20, True, 8, 95,
                    85, 80, 75, 70, 65, 75, 60
                ],
                outputs=[
                    api_key, language, company_name, founded_year, industry, stage, revenue_type,
                    monthly_revenue, growth_rate, arpu, gross_margin, monthly_churn,
                    retention_rate, new_customers, monthly_marketing, monthly_sales,
                    cash_balance, burn_rate,
                    idea_validation, market_research, prototype_stage, team_experience,
                    domain_expertise, startup_experience, partnerships, advisors,
                    pilot_customers, sales_started, customer_validation, launch_readiness,
                    team_strength, market_opportunity, product_stage, competitive_advantage,
                    marketing_channels, funding_efficiency, other_factors
                ]
            )
    
    return demo

# μ‹€ν–‰
if __name__ == "__main__":
    demo = create_ui()
    demo.launch(share=True)