SPB Git

spb/llmindex Public

The discriminative, contamination-resistant, fully transparent LLM ranking — updated live.

TypeScript 77.9% TeX 15.2% Python 3.7% SQL 1.4% JavaScript 1.1% Shell 0.5%
962 B · 31 lines typescript
Raw Blame History
1/**2 * llmindex.io — worker environment loading + cost guardrails3 * Author:  Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * License: Proprietary — © Simon-Pierre Boucher, all rights reserved6 */7import { existsSync } from 'node:fs';8import { resolve } from 'node:path';910// Load the repo-root .env when present (worker runs via tsx, no framework loader).11for (const candidate of [resolve(process.cwd(), '.env'), resolve(process.cwd(), '../../.env')]) {12  if (existsSync(candidate)) {13    try {14      process.loadEnvFile(candidate);15    } catch {16      /* ignore malformed env file lines */17    }18    break;19  }20}2122/** Hard cap per batch: the worker refuses to start a batch estimated above this. */23export function maxRunCostUsd(): number {24  const v = Number(process.env.MAX_RUN_COST_USD ?? 50);25  return Number.isFinite(v) && v > 0 ? v : 50;26}2728export function redisUrl(): string {29  return process.env.REDIS_URL ?? 'redis://127.0.0.1:6379';30}31