feat: full-platform STT API (v2.3 consensus plan) #1

Open
lukehemmin wants to merge 21 commits from feat/full-platform into main
2 changed files with 19 additions and 27 deletions
Showing only changes of commit f385734630 - Show all commits
+3 -3
View File
@@ -59,7 +59,7 @@
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": "# 3) venv + 설치 (GPU 추론은 engine+api만으로 충분 — Colab T4에 CUDA 런타임 내장)\n!python3 -m venv .venv\n!source .venv/bin/activate && pip install -q --upgrade pip\n!source .venv/bin/activate && pip install -q -e '.[engine,api]'\n!source .venv/bin/activate && pip install -q edge-tts # 샘플 음성 생성용\n\n# 이후 셀에서 activate 없이 CLI 사용 가능하게 PATH 등록\nimport os\nos.environ['PATH'] = '/content/luke_scribe/.venv/bin:' + os.environ['PATH']\nprint('설치 완료')\n!luke-scribe --help 2>&1 | head -12\n" "source": "# 3) 설치 — Colab은 시스템 pip가 표준 (venv는 Colab에서 ensurepip 오류로 실패할 수 있음)\n!pip install -q --upgrade pip\n!pip install -q -e '.[engine,api]'\n!pip install -q edge-tts # 샘플 음성 생성용\nprint('설치 완료')\n!which luke-scribe && luke-scribe --help 2>&1 | head -8\n"
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@@ -83,7 +83,7 @@
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": "# 5) 테스트 스위트\n!source .venv/bin/activate && python -m pytest tests/ -q 2>&1 | tail -5\n" "source": "# 5) 테스트 스위트\n!python -m pytest tests/ -q 2>&1 | tail -5\n"
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
@@ -133,7 +133,7 @@
"execution_count": null, "execution_count": null,
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": "# 10) 서버 기동 (in-proc 큐, 백그라운드)\nimport subprocess, time, os, json\nenv = dict(os.environ)\nenv['LUKESCRIBE_API_KEY_FILE'] = '/content/api_keys.json'\nenv['LUKESCRIBE_QUEUE_BACKEND'] = 'inproc'\nproc = subprocess.Popen(\n ['luke-scribe', 'serve', '--port', '8000'],\n env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,\n)\n# 기동 대기\nimport urllib.request\nfor _ in range(30):\n try:\n urllib.request.urlopen('http://localhost:8000/health', timeout=1)\n break\n except Exception:\n time.sleep(1)\nprint('서버 기동 OK')\n" "source": "# 10) 서버 기동 (in-proc 큐, 백그라운드 — Colab에서는 %%bash --bg 또는 nohup 사용)\n!mkdir -p /content/logs\n!nohup luke-scribe serve --port 8000 > /content/logs/server.log 2>&1 &\nimport time, urllib.request\nok = False\nfor _ in range(40):\n try:\n urllib.request.urlopen('http://localhost:8000/health', timeout=1)\n ok = True\n break\n except Exception:\n time.sleep(1)\nprint('서버 기동 OK' if ok else '서버 기동 실패 — 로그:')\nif not ok:\n print(open('/content/logs/server.log').read()[-1500:])\n"
}, },
{ {
"cell_type": "code", "cell_type": "code",
+16 -24
View File
@@ -93,17 +93,12 @@ def cells() -> list[dict]:
"!ffprobe -version 2>&1 | head -1\n" "!ffprobe -version 2>&1 | head -1\n"
), ),
code( code(
"# 3) venv + 설치 (GPU 추론은 engine+api만으로 충분 — Colab T4에 CUDA 런타임 내장)\n" "# 3) 설치 — Colab은 시스템 pip가 표준 (venv는 Colab에서 ensurepip 오류로 실패할 수 있음)\n"
"!python3 -m venv .venv\n" "!pip install -q --upgrade pip\n"
"!source .venv/bin/activate && pip install -q --upgrade pip\n" "!pip install -q -e '.[engine,api]'\n"
"!source .venv/bin/activate && pip install -q -e '.[engine,api]'\n" "!pip install -q edge-tts # 샘플 음성 생성용\n"
"!source .venv/bin/activate && pip install -q edge-tts # 샘플 음성 생성용\n"
"\n"
"# 이후 셀에서 activate 없이 CLI 사용 가능하게 PATH 등록\n"
"import os\n"
"os.environ['PATH'] = '/content/luke_scribe/.venv/bin:' + os.environ['PATH']\n"
"print('설치 완료')\n" "print('설치 완료')\n"
"!luke-scribe --help 2>&1 | head -12\n" "!which luke-scribe && luke-scribe --help 2>&1 | head -8\n"
), ),
md( md(
"## 3) 하드웨어 감지 — T4 GPU 실제 확인\n" "## 3) 하드웨어 감지 — T4 GPU 실제 확인\n"
@@ -118,7 +113,7 @@ def cells() -> list[dict]:
md("## 4) 단위/통합 테스트 (127개)\n\nmock 기반 테스트가 GPU 환경에서도 전부 통과하는지 확인합니다."), md("## 4) 단위/통합 테스트 (127개)\n\nmock 기반 테스트가 GPU 환경에서도 전부 통과하는지 확인합니다."),
code( code(
"# 5) 테스트 스위트\n" "# 5) 테스트 스위트\n"
"!source .venv/bin/activate && python -m pytest tests/ -q 2>&1 | tail -5\n" "!python -m pytest tests/ -q 2>&1 | tail -5\n"
), ),
md( md(
"## 5) 실전 전사 (GPU)\n\n" "## 5) 실전 전사 (GPU)\n\n"
@@ -155,24 +150,21 @@ def cells() -> list[dict]:
"!luke-scribe key --create --scopes transcribe,admin --file /content/api_keys.json\n" "!luke-scribe key --create --scopes transcribe,admin --file /content/api_keys.json\n"
), ),
code( code(
"# 10) 서버 기동 (in-proc 큐, 백그라운드)\n" "# 10) 서버 기동 (in-proc 큐, 백그라운드 — Colab에서는 %%bash --bg 또는 nohup 사용)\n"
"import subprocess, time, os, json\n" "!mkdir -p /content/logs\n"
"env = dict(os.environ)\n" "!nohup luke-scribe serve --port 8000 > /content/logs/server.log 2>&1 &\n"
"env['LUKESCRIBE_API_KEY_FILE'] = '/content/api_keys.json'\n" "import time, urllib.request\n"
"env['LUKESCRIBE_QUEUE_BACKEND'] = 'inproc'\n" "ok = False\n"
"proc = subprocess.Popen(\n" "for _ in range(40):\n"
" ['luke-scribe', 'serve', '--port', '8000'],\n"
" env=env, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True,\n"
")\n"
"# 기동 대기\n"
"import urllib.request\n"
"for _ in range(30):\n"
" try:\n" " try:\n"
" urllib.request.urlopen('http://localhost:8000/health', timeout=1)\n" " urllib.request.urlopen('http://localhost:8000/health', timeout=1)\n"
" ok = True\n"
" break\n" " break\n"
" except Exception:\n" " except Exception:\n"
" time.sleep(1)\n" " time.sleep(1)\n"
"print('서버 기동 OK')\n" "print('서버 기동 OK' if ok else '서버 기동 실패 — 로그:')\n"
"if not ok:\n"
" print(open('/content/logs/server.log').read()[-1500:])\n"
), ),
code( code(
"# 11) 업로드 → poll → 결과\n" "# 11) 업로드 → poll → 결과\n"