feat(config): add GPU_SERVER_URL alias for CF_ORCH_URL
Self-hoster-friendly env var name. Priority: GPU_SERVER_URL → CF_ORCH_URL (compat) → https://orch.circuitforge.tech when CF_LICENSE_KEY is present (Paid+ auto-default). Resolved value written back to os.environ["CF_ORCH_URL"] at startup so all service callers remain unchanged. Bump version to 0.10.0.
This commit is contained in:
parent
b326d4aa6e
commit
51a48a430b
3 changed files with 32 additions and 9 deletions
16
.env.example
16
.env.example
|
|
@ -21,10 +21,12 @@ DATA_DIR=./data
|
||||||
# IP this machine advertises to the coordinator (must be reachable from coordinator host)
|
# IP this machine advertises to the coordinator (must be reachable from coordinator host)
|
||||||
# CF_ORCH_ADVERTISE_HOST=10.1.10.71
|
# CF_ORCH_ADVERTISE_HOST=10.1.10.71
|
||||||
|
|
||||||
# CF-core hosted coordinator (managed cloud GPU inference — Paid+ tier)
|
# GPU inference server (cf-orch coordinator for recipe scan, LLM generation, etc.)
|
||||||
# Set CF_ORCH_URL to use a hosted cf-orch coordinator instead of self-hosting.
|
# GPU_SERVER_URL: set to your local cf-orch coordinator (self-hosted rack).
|
||||||
# CF_LICENSE_KEY is read automatically by CFOrchClient for bearer auth.
|
# CF_ORCH_URL is the backward-compat alias — both are honoured.
|
||||||
# CF_ORCH_URL=https://orch.circuitforge.tech
|
# Paid+ default: when CF_LICENSE_KEY is present and neither URL is set,
|
||||||
|
# the app automatically points to https://orch.circuitforge.tech.
|
||||||
|
# GPU_SERVER_URL=http://10.1.10.71:7700
|
||||||
# CF_LICENSE_KEY=CFG-KIWI-xxxx-xxxx-xxxx
|
# CF_LICENSE_KEY=CFG-KIWI-xxxx-xxxx-xxxx
|
||||||
|
|
||||||
# LLM backend — env-var auto-config (no llm.yaml needed for bare-metal users)
|
# LLM backend — env-var auto-config (no llm.yaml needed for bare-metal users)
|
||||||
|
|
@ -57,9 +59,9 @@ CF_APP_NAME=kiwi
|
||||||
# Unset = auto-detect: true if CLOUD_MODE or circuitforge_orch is installed (paid+ local).
|
# Unset = auto-detect: true if CLOUD_MODE or circuitforge_orch is installed (paid+ local).
|
||||||
# Set false to force LocalScheduler even when cf-orch is present.
|
# Set false to force LocalScheduler even when cf-orch is present.
|
||||||
# USE_ORCH_SCHEDULER=false
|
# USE_ORCH_SCHEDULER=false
|
||||||
# CF_ORCH_URL: coordinator endpoint. Required for recipe scan (cf-docuvision) and
|
# GPU_SERVER_URL: cf-orch coordinator endpoint. Required for recipe scan (cf-docuvision)
|
||||||
# LLM features when CF_ORCH_URL is the only backend. Local rack: http://10.1.10.71:7700
|
# and LLM features on a self-hosted rack. CF_ORCH_URL is the backward-compat alias.
|
||||||
# CF_ORCH_URL=http://10.1.10.71:7700
|
# GPU_SERVER_URL=http://10.1.10.71:7700
|
||||||
|
|
||||||
# Cloud mode (set in compose.cloud.yml; also set here for reference)
|
# Cloud mode (set in compose.cloud.yml; also set here for reference)
|
||||||
# CLOUD_DATA_ROOT=/devl/kiwi-cloud-data
|
# CLOUD_DATA_ROOT=/devl/kiwi-cloud-data
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,24 @@ class Settings:
|
||||||
# Quality
|
# Quality
|
||||||
MIN_QUALITY_SCORE: float = float(os.environ.get("MIN_QUALITY_SCORE", "50.0"))
|
MIN_QUALITY_SCORE: float = float(os.environ.get("MIN_QUALITY_SCORE", "50.0"))
|
||||||
|
|
||||||
# CF-core resource coordinator (VRAM lease management)
|
# CF-core resource coordinator (VRAM lease management — lease broker, not inference)
|
||||||
COORDINATOR_URL: str = os.environ.get("COORDINATOR_URL", "http://localhost:7700")
|
COORDINATOR_URL: str = os.environ.get("COORDINATOR_URL", "http://localhost:7700")
|
||||||
|
|
||||||
|
# GPU inference server URL
|
||||||
|
# Priority: GPU_SERVER_URL env var → CF_ORCH_URL env var (backward compat)
|
||||||
|
# → https://orch.circuitforge.tech when CF_LICENSE_KEY is present (Paid+)
|
||||||
|
# Resolved value is written back to os.environ["CF_ORCH_URL"] at startup so
|
||||||
|
# all service-layer callers that read CF_ORCH_URL directly see the right URL.
|
||||||
|
GPU_SERVER_URL: str | None = (
|
||||||
|
os.environ.get("GPU_SERVER_URL")
|
||||||
|
or os.environ.get("CF_ORCH_URL")
|
||||||
|
or (
|
||||||
|
"https://orch.circuitforge.tech"
|
||||||
|
if os.environ.get("CF_LICENSE_KEY")
|
||||||
|
else None
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
# Hosted cf-orch coordinator — bearer token for managed cloud GPU inference (Paid+)
|
# Hosted cf-orch coordinator — bearer token for managed cloud GPU inference (Paid+)
|
||||||
# CFOrchClient reads CF_LICENSE_KEY automatically; exposed here for startup validation.
|
# CFOrchClient reads CF_LICENSE_KEY automatically; exposed here for startup validation.
|
||||||
CF_LICENSE_KEY: str | None = os.environ.get("CF_LICENSE_KEY")
|
CF_LICENSE_KEY: str | None = os.environ.get("CF_LICENSE_KEY")
|
||||||
|
|
@ -108,3 +123,9 @@ class Settings:
|
||||||
|
|
||||||
|
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
|
|
||||||
|
# Normalise GPU_SERVER_URL into CF_ORCH_URL so every service-layer caller that
|
||||||
|
# reads os.environ.get("CF_ORCH_URL") sees the resolved value, including the
|
||||||
|
# Paid+ cloud default injected above.
|
||||||
|
if settings.GPU_SERVER_URL:
|
||||||
|
os.environ["CF_ORCH_URL"] = settings.GPU_SERVER_URL
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||||
|
|
||||||
[project]
|
[project]
|
||||||
name = "kiwi"
|
name = "kiwi"
|
||||||
version = "0.6.0"
|
version = "0.10.0"
|
||||||
description = "Pantry tracking + leftover recipe suggestions"
|
description = "Pantry tracking + leftover recipe suggestions"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
requires-python = ">=3.11"
|
requires-python = ">=3.11"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue