That installs upstream PyTorch. To use torchnative instead, run uv sync --extra torchnative. The two extras cannot be installed together.
이렇게 하면 upstream PyTorch 가 설치됩니다. 대신 torchnative 를 쓰려면 uv sync --extra torchnative 를 실행하세요. 두 extra 는 함께 설치할 수 없습니다.
python -m api run server # 127.0.0.1:23100 (loopback only)
-python -m api run server 127.0.0.1 23100 # explicit host and port
+uv run --extra torch python -m api run server # 127.0.0.1:23100 (loopback only)
+uv run --extra torch python -m api run server 127.0.0.1 23100 # explicit host and port
+ uv run uses the environment uv sync created, so there is no virtual environment to activate. Use --extra torchnative if you installed that one. Logs go to the console at INFO; set GEMSTONE_LOG_LEVEL=DEBUG to also log prompts and answers.
uv run 은 uv sync 가 만든 환경을 쓰므로 가상환경을 따로 활성화할 필요가 없습니다. torchnative 를 설치했다면 --extra torchnative 를 쓰세요. 로그는 INFO 수준으로 콘솔에 나가며, GEMSTONE_LOG_LEVEL=DEBUG 를 설정하면 프롬프트와 답변도 기록합니다.
The model downloads from Hugging Face the first time a session uses it — several gigabytes, once.
모델은 세션이 처음 사용할 때 Hugging Face 에서 내려받습니다 — 수 GB, 한 번만.
python -m api without run server crashes with IndexError — always pass both words.run server 없이 python -m api 를 실행하면 IndexError 로 죽습니다 — 두 단어를 꼭 넘기세요.ModuleNotFoundError from a bare python -m api run server means that is the system Python, not the synced environment — start it with uv run --extra torch as above.python -m api run server 에서 ModuleNotFoundError 가 나면 동기화된 환경이 아니라 시스템 Python 인 것입니다 — 위처럼 uv run --extra torch 로 실행하세요.The Android client has no address setting yet, so adb reverse is the simplest way to reach a server on the same computer from a phone or an emulator. The server listens on 127.0.0.1 by default, which is enough for this.
Android 클라이언트에는 아직 주소 설정이 없으므로, 휴대폰이나 에뮬레이터에서 같은 컴퓨터의 서버로 가는 가장 간단한 방법은 adb reverse 입니다. 서버는 기본적으로 127.0.0.1 에서 받으며, 이것으로 충분합니다.
GEMSTONE_HOST=0.0.0.0 GEMSTONE_API_KEY=change-me python -m api run server
+GEMSTONE_HOST=0.0.0.0 GEMSTONE_API_KEY=change-me uv run --extra torch python -m api run server
GEMSTONE_API_KEY=change-me ./gradlew :app:run --args="--server http://192.168.0.10:23100"
GEMSTONE_HOST sets the server's bind address (host or host:port); the default is 127.0.0.1. Binding beyond loopback without GEMSTONE_API_KEY prints one warning at start-up but is allowed, as in Ollama. A browser on another machine may need its origin listed in GEMSTONE_ORIGINS. A phone on the LAN cannot be pointed at the server until Android gets an address setting; meanwhile forward a port from a machine that can reach it and use adb reverse as above.
GEMSTONE_HOST 는 서버가 받는 주소(host 또는 host:port)를 정하며 기본값은 127.0.0.1 입니다. 루프백 밖으로 열면서 GEMSTONE_API_KEY 가 없으면 시작할 때 경고를 한 번 출력하지만, Ollama 와 같게 막지는 않습니다. 다른 기기의 브라우저는 그 출처를 GEMSTONE_ORIGINS 에 적어야 할 수 있습니다. Android 에 주소 설정이 생기기 전까지는 LAN 의 휴대폰이 서버를 가리키게 할 수 없습니다. 그동안은 서버에 닿는 컴퓨터에서 포트를 전달하고 위처럼 adb reverse 를 쓰세요.
diff --git a/docs/guide/guide-server.html b/docs/guide/guide-server.html
index bfa7fe1b..dafbd2af 100644
--- a/docs/guide/guide-server.html
+++ b/docs/guide/guide-server.html
@@ -38,13 +38,13 @@ Run and configure the server
서버
Host and port
호스트와 포트
-python -m api run server [host] [port] [--reload] # defaults: 127.0.0.1 23100
-GEMSTONE_HOST=0.0.0.0:11434 python -m api run server # host[:port], like OLLAMA_HOST
+uv run --extra torch python -m api run server [host] [port] [--reload] # defaults: 127.0.0.1 23100
+GEMSTONE_HOST=0.0.0.0:11434 uv run --extra torch python -m api run server # host[:port], like OLLAMA_HOST
The server listens on loopback only. GEMSTONE_HOST overrides the address; the host and port arguments win over it. It reloads on code changes only with --reload or GEMSTONE_DEV=1, and keeps WebSockets alive for 300 seconds of silence — long enough for a slow first token.
서버는 loopback 에서만 듣습니다. GEMSTONE_HOST 로 주소를 바꾸며, host·port 인자가 우선합니다. 코드가 바뀔 때의 재시작은 --reload 또는 GEMSTONE_DEV=1 일 때만 하고, WebSocket 을 300초 침묵까지 유지합니다 — 느린 첫 토큰에도 충분합니다.
Origins and API key
Origin 과 API 키
Browsers may call the server from localhost, 127.0.0.1, [::1] (any port) and the server's own origin. Add others with GEMSTONE_ORIGINS (comma-separated, * allowed). A foreign origin gets no CORS headers, a state-changing request from it is answered 403, and its WebSocket is refused. Requests without an Origin header (the Ollama CLI, the SDKs) always pass.
브라우저는 localhost, 127.0.0.1, [::1] (모든 포트)과 서버 자신의 origin 에서 서버를 부를 수 있습니다. 다른 origin 은 GEMSTONE_ORIGINS (쉼표로 구분, * 허용)로 더합니다. 외부 origin 에는 CORS 헤더가 붙지 않고, 상태를 바꾸는 요청은 403, WebSocket 은 거절됩니다. Origin 헤더가 없는 요청(Ollama CLI, SDK)은 항상 통과합니다.
-GEMSTONE_API_KEY=s3cret python -m api run server
+GEMSTONE_API_KEY=s3cret uv run --extra torch python -m api run server
curl -H "Authorization: Bearer s3cret" http://127.0.0.1:23100/api/models
With GEMSTONE_API_KEY set, every route needs Authorization: Bearer <key>; a WebSocket may instead pass ?api_key=<key>. The web assets, HEAD / and GET /api/version stay open. Without a key on a non-loopback bind the server logs one warning at start-up and still serves, for Ollama compatibility.
API 키를 설정하면 모든 경로에 Authorization: Bearer <key> 가 필요하며, WebSocket 은 대신 ?api_key=<key> 를 쓸 수 있습니다. 웹 에셋, HEAD /, GET /api/version 은 열려 있습니다. loopback 이 아닌 주소에 키 없이 띄우면 시작 시 경고를 한 번 남기고 Ollama 호환을 위해 그대로 서비스합니다.