Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
104 lines (95 loc) · 4.79 KB
/
Copy path.env.example
File metadata and controls
104 lines (95 loc) · 4.79 KB
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
# =====================================================================
# SLMForge configuration
# Copy to `.env` and fill in. Never commit `.env` (it is gitignored).
# =====================================================================
# --- Core ---
SLMFORGE_ENV=local # local | dev | prod
SLMFORGE_HOST=127.0.0.1
SLMFORGE_PORT=8000
SLMFORGE_LOG_LEVEL=INFO
# SQLite for the prototype. Point at Postgres later if needed.
SLMFORGE_DATABASE_URL=sqlite:///./.data/slmforge.db
# Artifacts live on F: (the project drive) — C: has little free space.
SLMFORGE_ARTIFACT_ROOT=./artifacts
SLMFORGE_UPLOAD_ROOT=./uploads
# --- Planner LLM (reads the prompt, writes the spec and the training plan) ---
# This is NOT the model SLMForge trains. OpenRouter is a plain OpenAI-compatible
# gateway, so any provider/model id works without a code change.
SLMFORGE_LLM_PROVIDER=openrouter # openrouter | ollama | openai | anthropic | none
SLMFORGE_LLM_BASE_URL=https://openrouter.ai/api/v1
# Free reasoning model for the spec + training-method decision (low volume, high value).
SLMFORGE_LLM_MODEL=nvidia/nemotron-3-ultra-550b-a55b:free
# Cheaper/free model for bulk synthetic-example generation (high volume).
SLMFORGE_LLM_BULK_MODEL=google/gemma-4-26b-a4b-it:free
# Put your key here yourself — never paste it into a chat or a commit.
SLMFORGE_LLM_API_KEY=
# Fall back to a deterministic rule-based spec when no LLM is reachable, clearly
# labelled as heuristic rather than pretending it reasoned.
SLMFORGE_LLM_ALLOW_HEURISTIC_FALLBACK=true
# --- Model & dataset sources (Hugging Face) ---
# Preferred: authenticate the `hf` CLI once with `hf auth login`. The app shells
# out to `hf`, so it never needs to hold your token.
# Set this only if you want the in-process client to use it instead.
SLMFORGE_HF_TOKEN=
HF_TOKEN=
# Keep the model cache on the drive with free space, not the system drive.
HF_HOME=./.cache/huggingface
SLMFORGE_HF_HOME=./.cache/huggingface
SLMFORGE_HF_CLI_TIMEOUT_S=120
# --- Sign in with Hugging Face (OAuth) ---
# Create an app at https://huggingface.co/settings/applications/new and register
# exactly `<SLMFORGE_PUBLIC_BASE_URL>/api/auth/huggingface/callback` as its
# redirect URI. Both these names and their SLMFORGE_-prefixed forms are read.
# Leave blank to disable sign-in — the app still runs, just anonymously.
HF_CLIENT_ID=
HF_CLIENT_SECRET=
# Absolute URL the browser reaches the API on (used to build the redirect URI).
# In dev with the Vite server, keep the host consistent with the UI (localhost)
# so the session cookie is shared across ports; Vite proxies /api to :8000.
SLMFORGE_PUBLIC_BASE_URL=http://127.0.0.1:8000
SLMFORGE_HF_OAUTH_SCOPES=openid profile email
# Signs the session cookie. Optional: falls back to the client secret, which is
# fine for local use but rotates sessions whenever the secret does.
SLMFORGE_SESSION_SECRET=
# --- Network resilience ---
# The reference network resets TLS handshakes to huggingface.co under load.
# Every outbound call retries with exponential backoff before failing.
SLMFORGE_NETWORK_ATTEMPTS=5
SLMFORGE_NETWORK_BASE_DELAY_S=1.0
SLMFORGE_NETWORK_MAX_DELAY_S=20
# DuckDB is required by `hf datasets sql` and by dataset profiling.
SLMFORGE_DUCKDB_THREADS=4
# --- Sandbox (where untrusted code and training run) ---
# subprocess : fastest, weakest isolation — development only
# docker : real filesystem/network isolation, runs locally (DEFAULT)
# hf_jobs : managed ephemeral HF containers, incl. GPUs — needs HF credits
SLMFORGE_SANDBOX_BACKEND=docker
SLMFORGE_SANDBOX_IMAGE=slmforge/sandbox:latest
SLMFORGE_SANDBOX_CPU_LIMIT=8
SLMFORGE_SANDBOX_MEM_LIMIT_MB=16384
SLMFORGE_SANDBOX_TIMEOUT_S=7200
SLMFORGE_SANDBOX_NETWORK=deny # deny | allowlist | allow
# Used only when SLMFORGE_SANDBOX_BACKEND=hf_jobs. cpu-basic is $0.01/hr and is
# the cheap way to prove the Job path before spending on a GPU (t4-small $0.40/hr).
SLMFORGE_HF_JOBS_FLAVOR=cpu-basic
SLMFORGE_HF_JOBS_IMAGE=python:3.12-slim
# --- Training defaults (overridable per build) ---
SLMFORGE_MAX_TRAIN_MINUTES=60
SLMFORGE_MAX_VRAM_GB=8
SLMFORGE_DEFAULT_METHOD=qlora
SLMFORGE_SEED=42
# Without a CUDA build of torch this machine trains on CPU, which is very slow.
# `slmforge doctor` reports which build is active.
# --- Serving & deployment ---
# This account has no HF credits, so serving is local by default.
# hf_endpoint / hf_space require a paid plan; flip these on when credits exist.
SLMFORGE_DEPLOY_TARGET=local_openai # local_openai | hf_endpoint | hf_space
SLMFORGE_SERVE_BACKEND=openai_compat # openai_compat | ollama
SLMFORGE_SERVE_HOST=127.0.0.1
SLMFORGE_SERVE_PORT=8100
SLMFORGE_DEPLOY_REQUIRE_APPROVAL=true
SLMFORGE_HF_PUSH_ENABLED=false # push the adapter/merged model to the Hub
SLMFORGE_HF_PUSH_ON_DEPLOY=false
SLMFORGE_HF_ORG=
HF_CLIENT_ID=
HF_CLIENT_SECRET=