selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Lynkr logo

Self-host Lynkr

v9.6.0

LLM gateway that compresses and tier-routes coding traffic

ReleaseOpen SourceApache-2.0
docker run -d --name lynkr -p 8081:8081 -e MODEL_PROVIDER=databricks lynkr:latest
Updatedlast week
LanguageJavaScript
Setup difficultyEasy
Stars
639
RAM
8GB+ RAM for 7-8B models, 16GB+ RAM for 14B models (local model hosting)
Ports
8081 (HTTP proxy/gateway and built-in dashboard (configurable via PORT)), 8787 (optional Headroom context-compression sidecar container)
Requires
Node.js

What is Lynkr?

Lynkr is a Node.js gateway that fronts AI coding assistants — Claude Code, Cursor, the Codex CLI, Cline and Continue.dev — and answers both the Anthropic-style and the OpenAI-compatible endpoint formats, so clients need no code changes. On the way to the model it binary-compresses large JSON tool results (87.6% fewer tokens on a 60-item grep array in its own benchmark), drops tool schemas a request will not use, and answers near-duplicate prompts from a semantic cache in roughly 171ms with nothing billed. Each request can be scored for difficulty and sent to one of four tiers configured as provider:model pairs, keeping easy turns on a free local Ollama model while hard ones escalate to cloud capacity; sessions stay pinned to one model until a guard forces a re-route. A dashboard served under /dashboard reports spend, counterfactual savings, tier mix, routing accuracy, logs and provider health, alongside Prometheus metrics, health endpoints and a no-restart admin reload. Installation is a global npm package (also a Homebrew tap, a curl installer, Docker Compose or a source build), configuration is an interactive lynkr init wizard or a .env file, and the gateway listens on port 8081 with local SQLite files for its data. It is Apache 2.0 licensed, free, and the project itself notes that several provider entries are documented but not yet probed against live keys.

Should you self-host Lynkr?

Lynkr scores 48/100 on selfhost.directory (how scoring works) and ranks #59 of 125 in AI. It has 639 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is easy: most people get it running in one sitting. It is Apache-2.0-licensed and written mostly in JavaScript.

Its closest alternative on selfhost.directory is OmniRoute (88/100, 82 107 stars). It scores higher overall, so compare the two before you pick. See Lynkr vs OmniRoute side by side.

Features

  • Built-in Dashboard
  • Complexity tier routingAll four TIER_* variables must be set for tier routing to activate.
  • Cost tracking with model pricing
  • Health check endpoints
  • Interactive setup wizard
  • Load shedding and fallback
  • Long-term MemoryDisabled by default; enabled with MEMORY_ENABLED=true.
  • MCP Support
  • Prometheus Metrics
  • Semantic Caching
  • SSE streaming
  • Sticky Sessions
  • Token compression of tool results
  • Tool schema pruning
  • Wrap mode for AI coding tools

Lynkr README

How to install Lynkr

Install Lynkr with Docker

Environment variables
MODEL_PROVIDER, PORT, LOG_LEVEL
docker build -t lynkr:latest .
docker run -d \
  --name lynkr \
  -p 8081:8081 \
  -e MODEL_PROVIDER=databricks \
  lynkr:latest

Standalone container; credentials passed as environment variables and ./data mounted for persistence.

How to configure Lynkr

  • AGENTS_ENABLEDtrueDESCRIPTION: Inject agent-delegation instructions into the system prompt when the client declares a Task tool (tools always execute on the client). Values: true | false

    DESCRIPTION: Inject agent-delegation instructions into the system prompt when the client declares a Task tool (tools always execute on the client). Values: true | false

  • ANTHROPIC_API_KEYAnthropic (direct + OAuth subscription mode) OAuth mode: when using `lynkr wrap claude`, the OAuth token from `claude login` is forwarded automatically — no API key needed. DESCRIPTION: Anthropic API key. Only needed when NOT using OAuth subscription.

    Anthropic (direct + OAuth subscription mode) OAuth mode: when using `lynkr wrap claude`, the OAuth token from `claude login` is forwarded automatically — no API key needed. DESCRIPTION: Anthropic API key. Only needed when NOT using OAuth subscription.

  • ATLASCLOUD_API_KEYAtlas Cloud (OpenAI-compatible) DESCRIPTION: Atlas Cloud API key from https://www.atlascloud.ai/console/api-keys.

    Atlas Cloud (OpenAI-compatible) DESCRIPTION: Atlas Cloud API key from https://www.atlascloud.ai/console/api-keys.

  • ATLASCLOUD_ENDPOINThttps://api.atlascloud.ai/v1/chat/completionsDESCRIPTION: Atlas Cloud Chat Completions endpoint.

    DESCRIPTION: Atlas Cloud Chat Completions endpoint.

  • ATLASCLOUD_MODELqwen/qwen3.8-maxDESCRIPTION: Default Atlas Cloud text model.

    DESCRIPTION: Default Atlas Cloud text model.

  • AWS_BEDROCK_API_KEYAWS Bedrock (uses Bedrock API Key, NOT IAM) DESCRIPTION: Bedrock bearer API key (starts with ABSK, generated in AWS console).

    AWS Bedrock (uses Bedrock API Key, NOT IAM) DESCRIPTION: Bedrock bearer API key (starts with ABSK, generated in AWS console).

  • AWS_BEDROCK_MODEL_IDus.anthropic.claude-3-5-sonnet-20241022-v2:0DESCRIPTION: Default Bedrock model id (often a US inference profile).

    DESCRIPTION: Default Bedrock model id (often a US inference profile).

  • AWS_BEDROCK_REGIONus-east-1DESCRIPTION: AWS region.

    DESCRIPTION: AWS region.

  • AWS_REGIONDESCRIPTION: Fallback region if AWS_BEDROCK_REGION is unset.

    DESCRIPTION: Fallback region if AWS_BEDROCK_REGION is unset.

  • AZURE_ANTHROPIC_API_KEYDESCRIPTION: API key for Azure Anthropic. Not needed if OAuth token is being forwarded.

    DESCRIPTION: API key for Azure Anthropic. Not needed if OAuth token is being forwarded.

  • AZURE_ANTHROPIC_ENDPOINThttps://api.anthropic.com/v1/messagesAzure Anthropic (Anthropic-format endpoint, OAuth-friendly) DESCRIPTION: Endpoint URL for Azure-hosted Anthropic (also used as OAuth passthrough target).

    Azure Anthropic (Anthropic-format endpoint, OAuth-friendly) DESCRIPTION: Endpoint URL for Azure-hosted Anthropic (also used as OAuth passthrough target).

  • AZURE_ANTHROPIC_VERSION2023-06-01DESCRIPTION: Anthropic API version header.

    DESCRIPTION: Anthropic API version header.

  • AZURE_OPENAI_API_KEYDESCRIPTION: Azure OpenAI API key.

    DESCRIPTION: Azure OpenAI API key.

  • AZURE_OPENAI_API_VERSION2024-08-01-previewDESCRIPTION: API version to use.

    DESCRIPTION: API version to use.

  • AZURE_OPENAI_DEPLOYMENTgpt-4oDESCRIPTION: Deployment name (e.g. gpt-4o, gpt-5.2-chat).

    DESCRIPTION: Deployment name (e.g. gpt-4o, gpt-5.2-chat).

  • AZURE_OPENAI_ENDPOINTAzure OpenAI DESCRIPTION: Azure OpenAI endpoint URL (standard or AI Foundry format).

    Azure OpenAI DESCRIPTION: Azure OpenAI endpoint URL (standard or AI Foundry format).

  • BAIDU_API_KEYBaidu Qianfan (ERNIE) DESCRIPTION: Baidu Qianfan API key (format: bce-v3/ALTAK-...).

    Baidu Qianfan (ERNIE) DESCRIPTION: Baidu Qianfan API key (format: bce-v3/ALTAK-...).

  • BAIDU_ENDPOINThttps://qianfan.baidubce.com/v2/chat/completionsDESCRIPTION: Qianfan v2 OpenAI-compatible chat completions endpoint.

    DESCRIPTION: Qianfan v2 OpenAI-compatible chat completions endpoint.

  • BAIDU_MODELglm-5.2DESCRIPTION: Default Baidu ERNIE model.

    DESCRIPTION: Default Baidu ERNIE model.

  • CAVEMAN_ENABLEDDESCRIPTION: Caveman terse-output injection (cuts output tokens at the cost of style). Values: true | false

    DESCRIPTION: Caveman terse-output injection (cuts output tokens at the cost of style). Values: true | false

  • CAVEMAN_LEVELliteDESCRIPTION: Aggressiveness of the brevity instruction. Values: lite | full | ultra

    DESCRIPTION: Aggressiveness of the brevity instruction. Values: lite | full | ultra

  • CLUSTER_ENABLEDfalseDESCRIPTION: Run the proxy in multi-worker cluster mode. Values: true | false

    DESCRIPTION: Run the proxy in multi-worker cluster mode. Values: true | false

  • CLUSTER_WORKERSautoDESCRIPTION: Worker count. Values: auto | <integer>

    DESCRIPTION: Worker count. Values: auto | <integer>

  • CODE_GRAPH_COMMANDgraphifyDESCRIPTION: External indexer binary the code-graph feature shells out to.

    DESCRIPTION: External indexer binary the code-graph feature shells out to.

  • CODE_GRAPH_ENABLEDfalseDESCRIPTION: Master switch for the code-graph indexer. Values: true | false

    DESCRIPTION: Master switch for the code-graph indexer. Values: true | false

  • CODE_GRAPH_TIMEOUT10000DESCRIPTION: Per-call timeout (ms).

    DESCRIPTION: Per-call timeout (ms).

  • CODE_GRAPH_WORKSPACEDESCRIPTION: Workspace path the indexer operates on (defaults to cwd).

    DESCRIPTION: Workspace path the indexer operates on (defaults to cwd).

  • CODEX_BINARY_PATHDESCRIPTION: Path to the `codex` binary; auto-detected if unset.

    DESCRIPTION: Path to the `codex` binary; auto-detected if unset.

  • CODEX_ENABLEDCodex (uses your ChatGPT subscription via local codex CLI) DESCRIPTION: Enable the Codex local provider (requires `codex` CLI installed). Values: true | false

    Codex (uses your ChatGPT subscription via local codex CLI) DESCRIPTION: Enable the Codex local provider (requires `codex` CLI installed). Values: true | false

  • CODEX_MODELDESCRIPTION: Codex model id.

    DESCRIPTION: Codex model id.

  • CODEX_TIMEOUTDESCRIPTION: Per-request timeout in ms.

    DESCRIPTION: Per-request timeout in ms.

  • CURSOR_AUTO_APPROVEDESCRIPTION: Auto-approve ALL cursor-agent permission requests, shell execution included (passes --force). The sandbox cwd is not a security boundary while this is on. Set false to approve MCPs only and reject edit/execute/delete requests. Values: true | false

    DESCRIPTION: Auto-approve ALL cursor-agent permission requests, shell execution included (passes --force). The sandbox cwd is not a security boundary while this is on. Set false to approve MCPs only and reject edit/execute/delete requests. Values: true | false

  • CURSOR_BINARY_PATHDESCRIPTION: Path to the `cursor-agent` binary; auto-detected if unset.

    DESCRIPTION: Path to the `cursor-agent` binary; auto-detected if unset.

  • CURSOR_ENABLEDCursor (uses your Cursor Pro subscription via local cursor-agent CLI) DESCRIPTION: Enable the Cursor local provider (requires `cursor-agent` CLI installed + `agent login`). Values: true | false

    Cursor (uses your Cursor Pro subscription via local cursor-agent CLI) DESCRIPTION: Enable the Cursor local provider (requires `cursor-agent` CLI installed + `agent login`). Values: true | false

  • CURSOR_MODELDESCRIPTION: Cursor model id (run `cursor-agent models` to list).

    DESCRIPTION: Cursor model id (run `cursor-agent models` to list).

  • CURSOR_TIMEOUTDESCRIPTION: Per-request timeout in ms.

    DESCRIPTION: Per-request timeout in ms.

  • DATABRICKS_API_BASEDatabricks DESCRIPTION: Databricks workspace base URL.

    Databricks DESCRIPTION: Databricks workspace base URL.

  • DATABRICKS_API_KEYDESCRIPTION: Databricks personal access token.

    DESCRIPTION: Databricks personal access token.

  • DATABRICKS_ENDPOINT_PATHDESCRIPTION: Path to the serving endpoint to invoke.

    DESCRIPTION: Path to the serving endpoint to invoke.

  • DEBUG_SQLDESCRIPTION: Pretty-print SQL statements to stdout (very verbose). Values: 1 | unset

    DESCRIPTION: Pretty-print SQL statements to stdout (very verbose). Values: 1 | unset

  • EDENAI_API_KEYEden AI (600+ models via single API, OpenAI-compatible, EU/GDPR) DESCRIPTION: Eden AI API key.

    Eden AI (600+ models via single API, OpenAI-compatible, EU/GDPR) DESCRIPTION: Eden AI API key.

  • EDENAI_EMBEDDINGS_MODELopenai/text-embedding-ada-002DESCRIPTION: Embedding model used through Eden AI.

    DESCRIPTION: Embedding model used through Eden AI.

  • EDENAI_ENDPOINThttps://api.edenai.run/v3/chat/completionsDESCRIPTION: Eden AI chat completions endpoint (OpenAI-compatible v3).

    DESCRIPTION: Eden AI chat completions endpoint (OpenAI-compatible v3).

  • EDENAI_MODELopenai/gpt-4o-miniDESCRIPTION: Default Eden AI model (provider/model naming).

    DESCRIPTION: Default Eden AI model (provider/model naming).

  • EMBEDDINGS_PROVIDEREmbeddings provider override DESCRIPTION: Force a specific embeddings provider (otherwise inferred from MODEL_PROVIDER). One of: ollama, llamacpp, openrouter, openai

    Embeddings provider override DESCRIPTION: Force a specific embeddings provider (otherwise inferred from MODEL_PROVIDER). One of: ollama, llamacpp, openrouter, openai

  • FALLBACK_ENABLEDfalseDESCRIPTION: Auto-fallback when the tier provider fails. Auto-true under tier routing. Values: true | false

    DESCRIPTION: Auto-fallback when the tier provider fails. Auto-true under tier routing. Values: true | false

  • FALLBACK_PROVIDERdatabricksDESCRIPTION: Fallback provider when tier provider fails (cannot be local). One of: databricks, azure-anthropic, azure-openai, openrouter, edenai, openai, atlas, bedrock

    DESCRIPTION: Fallback provider when tier provider fails (cannot be local). One of: databricks, azure-anthropic, azure-openai, openrouter, edenai, openai, atlas, bedrock

  • FILES_MAX_COUNT1000DESCRIPTION: Max stored files (LRU cap).

    DESCRIPTION: Max stored files (LRU cap).

  • FILES_MAX_SIZE_MB100DESCRIPTION: Max per-file size in MB.

    DESCRIPTION: Max per-file size in MB.

  • FILES_STORAGE_PATH./data/filesDESCRIPTION: Storage path for the Files tool.

    DESCRIPTION: Storage path for the Files tool.

  • FIREWORKS_API_KEYFireworks AI (serverless open models) DESCRIPTION: Fireworks API key (format: fw-...). Get one at fireworks.ai.

    Fireworks AI (serverless open models) DESCRIPTION: Fireworks API key (format: fw-...). Get one at fireworks.ai.

  • FIREWORKS_ENDPOINThttps://api.fireworks.ai/inference/v1/chat/completionsDESCRIPTION: Fireworks OpenAI-compatible chat completions endpoint.

    DESCRIPTION: Fireworks OpenAI-compatible chat completions endpoint.

  • FIREWORKS_MODELaccounts/fireworks/models/kimi-k2-instruct-0905DESCRIPTION: Default Fireworks model (long-form serverless id). Dated suffixes rotate — check https://app.fireworks.ai/models for current ids.

    DESCRIPTION: Default Fireworks model (long-form serverless id). Dated suffixes rotate — check https://app.fireworks.ai/models for current ids.

  • FIREWORKS_REASONING_EFFORTFireworks / OpenAI-compatible: reasoning effort and schema forwarding

    Fireworks / OpenAI-compatible: reasoning effort and schema forwarding

  • FIREWORKS_REASONING_EFFORT_MAP
  • FMT_GUARD_ENABLEDDisable the markdown format guard (contradicts clients that demand raw JSON).

    Disable the markdown format guard (contradicts clients that demand raw JSON).

  • FORCE_TIER_PATTERNSRouting hygiene for agent harnesses / structured-output clients Disable keyword-driven force escalation (shouldForceCloud/shouldForceReasoning).

    Routing hygiene for agent harnesses / structured-output clients Disable keyword-driven force escalation (shouldForceCloud/shouldForceReasoning).

  • GCF_ENABLEDfalseDESCRIPTION: Enable GCF (Graph Compact Format) encoding for large structured payloads. Drop-in alternative to TOON; takes precedence over TOON when enabled. Opt-in. Values: true | false

    DESCRIPTION: Enable GCF (Graph Compact Format) encoding for large structured payloads. Drop-in alternative to TOON; takes precedence over TOON when enabled. Opt-in. Values: true | false

  • GCF_FAIL_OPENtrueDESCRIPTION: Continue without GCF on encoder failure instead of erroring. Values: true | false

    DESCRIPTION: Continue without GCF on encoder failure instead of erroring. Values: true | false

  • GCF_LOG_STATStrueDESCRIPTION: Log per-request GCF savings stats. Values: true | false

    DESCRIPTION: Log per-request GCF savings stats. Values: true | false

  • GCF_MIN_BYTES4096DESCRIPTION: Minimum byte size before GCF encoding kicks in.

    DESCRIPTION: Minimum byte size before GCF encoding kicks in.

  • GCF_VERIFYtrueDESCRIPTION: Round-trip verify each encoding and keep the original JSON on any mismatch (makes the compression provably lossless per payload; adds one decode per converted blob). Values: true | false

    DESCRIPTION: Round-trip verify each encoding and keep the original JSON on any mismatch (makes the compression provably lossless per payload; adds one decode per converted blob). Values: true | false

  • GOOGLE_API_KEYDESCRIPTION: Fallback Google API key if VERTEX_API_KEY is unset.

    DESCRIPTION: Fallback Google API key if VERTEX_API_KEY is unset.

  • HEADROOM_CACHE_ALIGNERtrueDESCRIPTION: Cache-aligner transform (align cache breakpoints). Values: true | false

    DESCRIPTION: Cache-aligner transform (align cache breakpoints). Values: true | false

  • HEADROOM_CCRtrueDESCRIPTION: CCR (Compress-Cache-Retrieve) mode. Values: true | false

    DESCRIPTION: CCR (Compress-Cache-Retrieve) mode. Values: true | false

  • HEADROOM_CCR_TTL300DESCRIPTION: TTL for CCR cached chunks (seconds).

    DESCRIPTION: TTL for CCR cached chunks (seconds).

  • HEADROOM_DOCKER_AUTO_BUILDtrueDESCRIPTION: Auto-build the image if not found locally. Values: true | false

    DESCRIPTION: Auto-build the image if not found locally. Values: true | false

  • HEADROOM_DOCKER_BUILD_CONTEXT./headroom-sidecarDESCRIPTION: Build context path when auto-building the sidecar image.

    DESCRIPTION: Build context path when auto-building the sidecar image.

  • HEADROOM_DOCKER_CONTAINER_NAMElynkr-headroomDESCRIPTION: Sidecar container name.

    DESCRIPTION: Sidecar container name.

  • HEADROOM_DOCKER_CPU_LIMIT1.0DESCRIPTION: Sidecar CPU limit.

    DESCRIPTION: Sidecar CPU limit.

  • HEADROOM_DOCKER_ENABLEDtrueDESCRIPTION: Auto-manage a Docker container for the sidecar. Values: true | false

    DESCRIPTION: Auto-manage a Docker container for the sidecar. Values: true | false

  • HEADROOM_DOCKER_IMAGElynkr/headroom-sidecar:latestDESCRIPTION: Sidecar image name.

    DESCRIPTION: Sidecar image name.

  • HEADROOM_DOCKER_MEMORY_LIMIT512mDESCRIPTION: Sidecar memory limit.

    DESCRIPTION: Sidecar memory limit.

  • HEADROOM_DOCKER_NETWORKDESCRIPTION: Optional Docker network the sidecar joins.

    DESCRIPTION: Optional Docker network the sidecar joins.

  • HEADROOM_DOCKER_PORT8787DESCRIPTION: Host port the sidecar publishes on.

    DESCRIPTION: Host port the sidecar publishes on.

  • HEADROOM_DOCKER_RESTART_POLICYunless-stoppedDESCRIPTION: Docker restart policy for the sidecar.

    DESCRIPTION: Docker restart policy for the sidecar.

  • HEADROOM_ENABLEDtrueDESCRIPTION: Master switch for Headroom sidecar context compression. Values: true | false

    DESCRIPTION: Master switch for Headroom sidecar context compression. Values: true | false

  • HEADROOM_ENDPOINThttp://localhost:8787DESCRIPTION: Headroom sidecar endpoint.

    DESCRIPTION: Headroom sidecar endpoint.

  • HEADROOM_KEEP_TURNS10DESCRIPTION: How many recent turns the rolling window keeps verbatim.

    DESCRIPTION: How many recent turns the rolling window keeps verbatim.

  • HEADROOM_LLMLINGUAfalseDESCRIPTION: LLMLingua ML compression (requires GPU). Values: true | false

    DESCRIPTION: LLMLingua ML compression (requires GPU). Values: true | false

  • HEADROOM_LLMLINGUA_DEVICEautoDESCRIPTION: Device for LLMLingua model. Values: auto | cpu | cuda | mps

    DESCRIPTION: Device for LLMLingua model. Values: auto | cpu | cuda | mps

  • HEADROOM_LOG_LEVELinfoDESCRIPTION: Sidecar log level. Values: debug | info | warning | error

    DESCRIPTION: Sidecar log level. Values: debug | info | warning | error

  • HEADROOM_MIN_TOKENSDESCRIPTION: Skip compression below this estimated token count.

    DESCRIPTION: Skip compression below this estimated token count.

  • HEADROOM_MODEoptimizeDESCRIPTION: Operating mode. Values: audit (observe only) | optimize (apply)

    DESCRIPTION: Operating mode. Values: audit (observe only) | optimize (apply)

  • HEADROOM_PROVIDERanthropicDESCRIPTION: Provider hint that selects which cache markers to emit. Values: anthropic | openai | google

    DESCRIPTION: Provider hint that selects which cache markers to emit. Values: anthropic | openai | google

  • HEADROOM_ROLLING_WINDOWtrueDESCRIPTION: Rolling-window transform (keep newest N turns intact). Values: true | false

    DESCRIPTION: Rolling-window transform (keep newest N turns intact). Values: true | false

  • HEADROOM_SMART_CRUSHERtrueDESCRIPTION: Smart-crusher transform (compress large text blocks). Values: true | false

    DESCRIPTION: Smart-crusher transform (compress large text blocks). Values: true | false

  • HEADROOM_SMART_CRUSHER_MAX_ITEMS15DESCRIPTION: Max items the smart-crusher processes per request.

    DESCRIPTION: Max items the smart-crusher processes per request.

  • HEADROOM_SMART_CRUSHER_MIN_TOKENSDESCRIPTION: Min token count before smart-crusher engages.

    DESCRIPTION: Min token count before smart-crusher engages.

  • HEADROOM_TIMEOUT_MS5000DESCRIPTION: Sidecar request timeout in ms.

    DESCRIPTION: Sidecar request timeout in ms.

  • HEADROOM_TOOL_CRUSHERtrueDESCRIPTION: Tool-crusher transform (compress large tool results). Values: true | false

    DESCRIPTION: Tool-crusher transform (compress large tool results). Values: true | false

  • HISTORY_COMPRESSION_ENABLEDtrueDESCRIPTION: Summarize older history turns instead of dropping them. Values: true | false

    DESCRIPTION: Summarize older history turns instead of dropping them. Values: true | false

  • HISTORY_KEEP_RECENT_TURNS10DESCRIPTION: How many recent turns to keep verbatim.

    DESCRIPTION: How many recent turns to keep verbatim.

  • HISTORY_SUMMARIZE_OLDERtrueDESCRIPTION: Summarize history older than the recent window. Values: true | false

    DESCRIPTION: Summarize history older than the recent window. Values: true | false

  • HOT_RELOAD_DEBOUNCE_MS1000DESCRIPTION: Debounce window for the reload watcher (ms).

    DESCRIPTION: Debounce window for the reload watcher (ms).

  • HOT_RELOAD_ENABLEDDESCRIPTION: Hot-reload config when .env changes. Values: true | false

    DESCRIPTION: Hot-reload config when .env changes. Values: true | false

  • INJECT_TOOLS_LLAMACPPtrueDESCRIPTION: Inject native tool definitions into llama.cpp requests. Values: true | false (default true)

    DESCRIPTION: Inject native tool definitions into llama.cpp requests. Values: true | false (default true)

  • INJECT_TOOLS_OLLAMAtrueDESCRIPTION: Inject native tool definitions into Ollama requests (for models without tool-calling). Values: true | false (default true)

    DESCRIPTION: Inject native tool definitions into Ollama requests (for models without tool-calling). Values: true | false (default true)

  • LARGE_PAYLOAD_OPTIMIZATIONtrueDESCRIPTION: Large-payload optimization (chunked encoding, streaming). Values: true | false

    DESCRIPTION: Large-payload optimization (chunked encoding, streaming). Values: true | false

  • LARGE_PAYLOAD_THRESHOLD1048576DESCRIPTION: Bytes that count as a "large" payload.

    DESCRIPTION: Bytes that count as a "large" payload.

  • LLAMACPP_API_KEYDESCRIPTION: Optional bearer token if your llama.cpp server requires auth.

    DESCRIPTION: Optional bearer token if your llama.cpp server requires auth.

  • LLAMACPP_EMBEDDINGS_ENDPOINThttp://localhost:8080/embeddingsDESCRIPTION: Embeddings endpoint (defaults to ENDPOINT + /embeddings).

    DESCRIPTION: Embeddings endpoint (defaults to ENDPOINT + /embeddings).

  • LLAMACPP_ENDPOINThttp://localhost:8080llama.cpp (local GGUF server) DESCRIPTION: llama.cpp server base URL.

    llama.cpp (local GGUF server) DESCRIPTION: llama.cpp server base URL.

  • LLAMACPP_MODELdefaultDESCRIPTION: llama.cpp model name to request.

    DESCRIPTION: llama.cpp model name to request.

  • LLAMACPP_TIMEOUT_MS120000DESCRIPTION: Per-request timeout in ms.

    DESCRIPTION: Per-request timeout in ms.

  • LLM_AUDIT_ANNOTATIONStrueDESCRIPTION: Include audit annotations on each entry. Values: true | false

    DESCRIPTION: Include audit annotations on each entry. Values: true | false

  • LLM_AUDIT_DEDUP_CACHE_SIZE100DESCRIPTION: LRU cache size for the dedup dictionary.

    DESCRIPTION: LRU cache size for the dedup dictionary.

  • LLM_AUDIT_DEDUP_DICT_PATHDESCRIPTION: Path to the dedup dictionary file.

    DESCRIPTION: Path to the dedup dictionary file.

  • LLM_AUDIT_DEDUP_ENABLEDtrueDESCRIPTION: Deduplicate repeated audit payloads via dictionary compression. Values: true | false

    DESCRIPTION: Deduplicate repeated audit payloads via dictionary compression. Values: true | false

  • LLM_AUDIT_DEDUP_MIN_SIZE500DESCRIPTION: Smallest payload size (bytes) eligible for dedup.

    DESCRIPTION: Smallest payload size (bytes) eligible for dedup.

  • LLM_AUDIT_DEDUP_SANITIZEtrueDESCRIPTION: Sanitize secrets out of dedup-eligible payloads. Values: true | false

    DESCRIPTION: Sanitize secrets out of dedup-eligible payloads. Values: true | false

  • LLM_AUDIT_DEDUP_SESSION_CACHEtrueDESCRIPTION: Cache dedup state per session. Values: true | false

    DESCRIPTION: Cache dedup state per session. Values: true | false

  • LLM_AUDIT_ENABLEDfalseDESCRIPTION: Master switch for the LLM audit log. Values: true | false

    DESCRIPTION: Master switch for the LLM audit log. Values: true | false

  • LLM_AUDIT_LOG_FILEDESCRIPTION: Audit log file path.

    DESCRIPTION: Audit log file path.

  • LLM_AUDIT_MAX_CONTENT_LENGTH5000DESCRIPTION: Legacy fallback for max content length.

    DESCRIPTION: Legacy fallback for max content length.

  • LLM_AUDIT_MAX_FILES30DESCRIPTION: Rotated audit file count.

    DESCRIPTION: Rotated audit file count.

  • LLM_AUDIT_MAX_RESPONSE_LENGTH3000DESCRIPTION: Max response chars retained per audit entry.

    DESCRIPTION: Max response chars retained per audit entry.

  • LLM_AUDIT_MAX_SIZE100MDESCRIPTION: Per-file rotation size.

    DESCRIPTION: Per-file rotation size.

  • LLM_AUDIT_MAX_SYSTEM_LENGTH2000DESCRIPTION: Max system-prompt chars retained per audit entry.

    DESCRIPTION: Max system-prompt chars retained per audit entry.

  • LLM_AUDIT_MAX_USER_LENGTH3000DESCRIPTION: Max user-message chars retained per audit entry.

    DESCRIPTION: Max user-message chars retained per audit entry.

  • LMSTUDIO_API_KEYDESCRIPTION: Optional bearer token.

    DESCRIPTION: Optional bearer token.

  • LMSTUDIO_ENDPOINThttp://localhost:1234LM Studio DESCRIPTION: LM Studio OpenAI-compatible endpoint.

    LM Studio DESCRIPTION: LM Studio OpenAI-compatible endpoint.

  • LMSTUDIO_MODELdefaultDESCRIPTION: LM Studio model id to request.

    DESCRIPTION: LM Studio model id to request.

  • LMSTUDIO_TIMEOUT_MS120000DESCRIPTION: Per-request timeout in ms.

    DESCRIPTION: Per-request timeout in ms.

  • LOAD_SHEDDING_ACTIVE_REQUESTS_THRESHOLD1000DESCRIPTION: In-flight request count above which load shedding triggers.

    DESCRIPTION: In-flight request count above which load shedding triggers.

  • LOAD_SHEDDING_HEAP_THRESHOLD0.95DESCRIPTION: Heap-utilization fraction above which load shedding triggers.

    DESCRIPTION: Heap-utilization fraction above which load shedding triggers.

  • LOAD_SHEDDING_MEMORY_THRESHOLD0.85DESCRIPTION: RSS-memory fraction above which load shedding triggers.

    DESCRIPTION: RSS-memory fraction above which load shedding triggers.

  • LOG_FILE_ENABLEDDESCRIPTION: Persistent file logging via pino-roll. Values: true | false

    DESCRIPTION: Persistent file logging via pino-roll. Values: true | false

  • LOG_FILE_FREQUENCYDESCRIPTION: Roll frequency. Values: daily | hourly | <bytes>

    DESCRIPTION: Roll frequency. Values: daily | hourly | <bytes>

  • LOG_FILE_LEVELDESCRIPTION: Log file verbosity.

    DESCRIPTION: Log file verbosity.

  • LOG_FILE_MAX_FILESDESCRIPTION: Max rotated files to retain.

    DESCRIPTION: Max rotated files to retain.

  • LOG_FILE_PATHDESCRIPTION: Log file path.

    DESCRIPTION: Log file path.

  • LOG_LEVELinfoDESCRIPTION: Pino log level. Values: trace | debug | info | warn | error | fatal | silent

    DESCRIPTION: Pino log level. Values: trace | debug | info | warn | error | fatal | silent

  • LYNKR_BUDGET_ENFORCERtrueDESCRIPTION: Master switch for the budget enforcer middleware. Values: true | false (set "false" to disable)

    DESCRIPTION: Master switch for the budget enforcer middleware. Values: true | false (set "false" to disable)

  • LYNKR_CACHE_BYPASS_STRUCTUREDStructured-output requests bypass the response cache (default true).

    Structured-output requests bypass the response cache (default true).

  • LYNKR_CASCADE_ENABLEDfalseDESCRIPTION: Enable cascading retry/escalation between tiers. Values: true | false

    DESCRIPTION: Enable cascading retry/escalation between tiers. Values: true | false

  • LYNKR_CASCADE_VERIFYDESCRIPTION: WS6 cascade verification (EXPERIMENTAL). After a cheap-tier (SIMPLE/MEDIUM) response, run structural checks (language drift, degeneration, truncation, malformed tool calls, empty/echo) plus a coarse content score. A failing answer is DISCARDED and the request escalates up the tier ladder — a routing mistake costs seconds, not a garbage answer. Failed attempts feed the learning loop as

    DESCRIPTION: WS6 cascade verification (EXPERIMENTAL). After a cheap-tier (SIMPLE/MEDIUM) response, run structural checks (language drift, degeneration, truncation, malformed tool calls, empty/echo) plus a coarse content score. A failing answer is DISCARDED and the request escalates up the tier ladder — a routing mistake costs seconds, not a garbage answer. Failed attempts feed the learning loop as

  • LYNKR_COST_OPTIMIZEtrueDESCRIPTION: Cost-optimized routing (downgrade tier when safe). Values: true | false

    DESCRIPTION: Cost-optimized routing (downgrade tier when safe). Values: true | false

  • LYNKR_DECISION_HEADERSEmit X-Lynkr-Decision / X-Lynkr-Decision-Tier / X-Lynkr-Signals response headers.

    Emit X-Lynkr-Decision / X-Lynkr-Decision-Tier / X-Lynkr-Signals response headers.

  • LYNKR_EMBEDDINGS_MAX_CHARSMax characters sent to the embedding model (default 5000; nomic-embed-text has a 2048-token context).

    Max characters sent to the embedding model (default 5000; nomic-embed-text has a 2048-token context).

  • LYNKR_FORWARD_RESPONSE_FORMATForward the client's output_format / response_format upstream (default true).

    Forward the client's output_format / response_format upstream (default true).

  • LYNKR_INTENT_DECAY0.7DESCRIPTION: Per-turn exponential decay applied during window scoring. weighted_score = raw_score * decay^age, where age=0 is the latest user message. Higher (~0.9) = old turns linger longer; lower (~0.5) = old turns forgotten faster. 0.7 means a complex turn from 4 messages back contributes ~24% of its raw score to the max comparison. Values: float in (0, 1] (default 0.7).

    DESCRIPTION: Per-turn exponential decay applied during window scoring. weighted_score = raw_score * decay^age, where age=0 is the latest user message. Higher (~0.9) = old turns linger longer; lower (~0.5) = old turns forgotten faster. 0.7 means a complex turn from 4 messages back contributes ~24% of its raw score to the max comparison. Values: float in (0, 1] (default 0.7).

  • LYNKR_INTENT_WINDOW_N5DESCRIPTION: For OAuth/subscription requests, score the last N user messages instead of just the latest one. Catches "this conversation HAD a complex turn earlier" (e.g. an "audit credentials" ask 4 turns back) without inflating short follow-ups ("yes", "continue"). Combined with LYNKR_INTENT_DECAY as exponential recency weighting; the message with the highest decayed score wins. Values: positive

    DESCRIPTION: For OAuth/subscription requests, score the last N user messages instead of just the latest one. Catches "this conversation HAD a complex turn earlier" (e.g. an "audit credentials" ask 4 turns back) without inflating short follow-ups ("yes", "continue"). Combined with LYNKR_INTENT_DECAY as exponential recency weighting; the message with the highest decayed score wins. Values: positive

  • LYNKR_KNN_CONFIDENCE_HIGH0.7DESCRIPTION: HIGH-confidence threshold above which a kNN suggestion overrides the tier-config model directly. Values in (0, 1].

    DESCRIPTION: HIGH-confidence threshold above which a kNN suggestion overrides the tier-config model directly. Values in (0, 1].

  • LYNKR_KNN_CONFIDENCE_LOW0.4DESCRIPTION: LOW-confidence threshold. Between LOW and HIGH the suggestion is treated as "ambiguous" and — subject to the WS2 leash (only escalate when telemetry.underProvisionedPct ≥ 2%) — may bump the tier one level for safety.

    DESCRIPTION: LOW-confidence threshold. Between LOW and HIGH the suggestion is treated as "ambiguous" and — subject to the WS2 leash (only escalate when telemetry.underProvisionedPct ≥ 2%) — may bump the tier one level for safety.

  • LYNKR_KNN_ENABLEDSkip the kNN router and its embedding call entirely.

    Skip the kNN router and its embedding call entirely.

  • LYNKR_KNN_MIN_INDEX_SIZE100---- Learning loop (WS5) ------------------------------------------- DESCRIPTION: Minimum kNN index size before the router will use its advice. Below this size the router returns null (heuristic wins). Post-WS5 the confidence returned by query() is also damped by min(1, size/1000) so a small index advises weakly rather than not at all. Default 100 (WS5 lowered from the pre-WS5 default of 1000).

    ---- Learning loop (WS5) ------------------------------------------- DESCRIPTION: Minimum kNN index size before the router will use its advice. Below this size the router returns null (heuristic wins). Post-WS5 the confidence returned by query() is also damped by min(1, size/1000) so a small index advises weakly rather than not at all. Default 100 (WS5 lowered from the pre-WS5 default of 1000).

  • LYNKR_MAX_SESSION_TURNS200DESCRIPTION: Hard cap on total turns per session. Unset = no cap. Recommended for agentic harnesses: 200

    DESCRIPTION: Hard cap on total turns per session. Unset = no cap. Recommended for agentic harnesses: 200

  • LYNKR_MAX_TOOL_TURNS50DESCRIPTION: Hard cap on consecutive tool-loop turns without new user text. Unset = no cap. Recommended for agentic harnesses: 50

    DESCRIPTION: Hard cap on consecutive tool-loop turns without new user text. Unset = no cap. Recommended for agentic harnesses: 50

  • LYNKR_NATIVE_PASSTHROUGHtrueDESCRIPTION: Kill switch for native-format streaming passthrough (Anthropic client + Anthropic upstream pipes SSE bytes straight through, skipping the buffered orchestrator). Values: true | false (default true)

    DESCRIPTION: Kill switch for native-format streaming passthrough (Anthropic client + Anthropic upstream pipes SSE bytes straight through, skipping the buffered orchestrator). Values: true | false (default true)

  • LYNKR_OAUTH_PASSTHROUGHDESCRIPTION: Forward incoming OAuth Bearer tokens straight to the upstream Anthropic endpoint. Set automatically by `lynkr wrap claude`. Values: true | false

    DESCRIPTION: Forward incoming OAuth Bearer tokens straight to the upstream Anthropic endpoint. Set automatically by `lynkr wrap claude`. Values: true | false

  • LYNKR_OAUTH_PASSTHROUGH_URLDESCRIPTION: Upstream URL used for OAuth passthrough (defaults to AZURE_ANTHROPIC_ENDPOINT).

    DESCRIPTION: Upstream URL used for OAuth passthrough (defaults to AZURE_ANTHROPIC_ENDPOINT).

  • LYNKR_OLLAMA_BUFFER_RESPONSEStrueDESCRIPTION: Buffer Ollama responses instead of streaming. Buffering repairs leaked <think> tags from thinking models (MiniMax) but delivers all at once. Values: true | false (default true — set false to stream)

    DESCRIPTION: Buffer Ollama responses instead of streaming. Buffering repairs leaked <think> tags from thinking models (MiniMax) but delivers all at once. Values: true | false (default true — set false to stream)

  • LYNKR_PIN_DRIFT_MARGIN5DESCRIPTION: WS1.5 upward-drift margin. A pinned session re-decides when the latest user message's heuristic score exceeds the pinned tier's calibrated ceiling + this margin. Smaller = pins escape sooner (more re-routes, better tier fidelity); larger = stickier pins (fewer cold cache reads, risk of under-tiering). Live guidance: with tool-baseline subtraction active, trivial turns score 5-15 and m

    DESCRIPTION: WS1.5 upward-drift margin. A pinned session re-decides when the latest user message's heuristic score exceeds the pinned tier's calibrated ceiling + this margin. Smaller = pins escape sooner (more re-routes, better tier fidelity); larger = stickier pins (fewer cold cache reads, risk of under-tiering). Live guidance: with tool-baseline subtraction active, trivial turns score 5-15 and m

  • LYNKR_PREFLIGHT_ENABLEDfalseDESCRIPTION: Run client-supplied preflight commands (cwd = workspace) and short-circuit if they all pass. Values: true | false

    DESCRIPTION: Run client-supplied preflight commands (cwd = workspace) and short-circuit if they all pass. Values: true | false

  • LYNKR_PREFLIGHT_TIMEOUT_MS120000DESCRIPTION: Per-command timeout for preflight checks, in ms.

    DESCRIPTION: Per-command timeout for preflight checks, in ms.

  • LYNKR_REGRET_ESTIMATORfalseDESCRIPTION: Enable the regret-estimator post-hoc routing critic. Values: true | false

    DESCRIPTION: Enable the regret-estimator post-hoc routing critic. Values: true | false

  • LYNKR_ROUTING_CONFIGDeclarative routing (signals → decisions) — config/routing.json Path to the routing config (default: config/routing.json; see config/routing.example.json). The default file has a single `legacy` decision, so routing is unchanged until you add decisions.

    Declarative routing (signals → decisions) — config/routing.json Path to the routing config (default: config/routing.json; see config/routing.example.json). The default file has a single `legacy` decision, so routing is unchanged until you add decisions.

  • LYNKR_SHADOW_POLICYDESCRIPTION: Shadow-mode policy name (records what an alt policy would do without applying it).

    DESCRIPTION: Shadow-mode policy name (records what an alt policy would do without applying it).

  • LYNKR_STICKY_SESSIONStrue---- Sticky sessions (WS1) ----------------------------------------- DESCRIPTION: Cache-aware sticky session pinning. Once a session is routed, subsequent turns reuse the pinned provider/model instead of re-deciding — avoids a cold-cache re-read (~10× that turn's input cost) on every provider switch. Re-decides on compaction, guard escalation (risk/context/vision), or economic downgrade below the

    ---- Sticky sessions (WS1) ----------------------------------------- DESCRIPTION: Cache-aware sticky session pinning. Once a session is routed, subsequent turns reuse the pinned provider/model instead of re-deciding — avoids a cold-cache re-read (~10× that turn's input cost) on every provider switch. Re-decides on compaction, guard escalation (risk/context/vision), or economic downgrade below the

  • LYNKR_STICKY_TTL_MS21600000DESCRIPTION: TTL for a session pin (ms). Older pins are evicted by the 5-minute cleanup tick in src/sessions/cleanup.js. Default: 6 hours (21_600_000 ms).

    DESCRIPTION: TTL for a session pin (ms). Older pins are evicted by the 5-minute cleanup tick in src/sessions/cleanup.js. Default: 6 hours (21_600_000 ms).

  • LYNKR_STREAM_IDLE_TIMEOUT_MS60000DESCRIPTION: Abort a passthrough stream when the upstream goes silent this long.

    DESCRIPTION: Abort a passthrough stream when the upstream goes silent this long.

  • LYNKR_STREAM_TRANSFORMtrueDESCRIPTION: Kill switch for cross-format streaming (OpenAI upstream SSE reshaped into Anthropic events in flight instead of buffering). Values: true | false (default true)

    DESCRIPTION: Kill switch for cross-format streaming (OpenAI upstream SSE reshaped into Anthropic events in flight instead of buffering). Values: true | false (default true)

  • LYNKR_STREAM_TRANSFORM_PROVIDERSDESCRIPTION: Providers eligible for the cross-format stream transform. Values: comma-separated (default openai,atlas,azure-openai,openrouter,databricks,lmstudio,llamacpp,moonshot)

    DESCRIPTION: Providers eligible for the cross-format stream transform. Values: comma-separated (default openai,atlas,azure-openai,openrouter,databricks,lmstudio,llamacpp,moonshot)

  • LYNKR_SWITCH_MAX_PROMPT_TOKENSDESCRIPTION: Prompt-token cap under which an economic downgrade may override the pin. Above this the cold-cache re-read dominates the per-token savings, so the pin wins even if the fresh routing decision picks a cheaper model. Default 20 000.

    DESCRIPTION: Prompt-token cap under which an economic downgrade may override the pin. Above this the cold-cache re-read dominates the per-token savings, so the pin wins even if the fresh routing decision picks a cheaper model. Default 20 000.

  • LYNKR_VISIBLE_ROUTINGfalseDESCRIPTION: Include `lynkr_interaction` block in every successful response showing where it routed. Values: true | false

    DESCRIPTION: Include `lynkr_interaction` block in every successful response showing where it routed. Values: true | false

  • LYNKR_WRAP_SHOW_STATStrueDESCRIPTION: Show stats summary on exit when running `lynkr wrap claude`. Values: true | false

    DESCRIPTION: Show stats summary on exit when running `lynkr wrap claude`. Values: true | false

  • MARKDOWN_RENDER_ANSIfalseDESCRIPTION: Render markdown to ANSI for CLIs without a markdown renderer. Leave false for Claude Code (it renders markdown itself). Values: true | false

    DESCRIPTION: Render markdown to ANSI for CLIs without a markdown renderer. Leave false for Claude Code (it renders markdown itself). Values: true | false

  • MCP_MANIFEST_DIRS~/.claude/mcpDESCRIPTION: Comma-separated directories scanned for MCP manifests.

    DESCRIPTION: Comma-separated directories scanned for MCP manifests.

  • MCP_SANDBOX_ADD_CAPABILITIESDESCRIPTION: Linux capabilities to add back.

    DESCRIPTION: Linux capabilities to add back.

  • MCP_SANDBOX_ALLOW_NETWORKINGfalseDESCRIPTION: Allow network access from inside the sandbox. Values: true | false

    DESCRIPTION: Allow network access from inside the sandbox. Values: true | false

  • MCP_SANDBOX_CONTAINER_WORKSPACE/workspaceDESCRIPTION: Workspace mount point inside the container.

    DESCRIPTION: Workspace mount point inside the container.

  • MCP_SANDBOX_CPU_LIMIT1.0DESCRIPTION: Container CPU limit (cores).

    DESCRIPTION: Container CPU limit (cores).

  • MCP_SANDBOX_DROP_CAPABILITIESALLDESCRIPTION: Linux capabilities to drop (comma-separated, or "ALL").

    DESCRIPTION: Linux capabilities to drop (comma-separated, or "ALL").

  • MCP_SANDBOX_ENABLEDtrueDESCRIPTION: Master switch for the MCP sandbox. Values: true | false

    DESCRIPTION: Master switch for the MCP sandbox. Values: true | false

  • MCP_SANDBOX_ENTRYPOINTDESCRIPTION: Override container entrypoint.

    DESCRIPTION: Override container entrypoint.

  • MCP_SANDBOX_EXTRA_MOUNTSDESCRIPTION: Extra bind mounts (HOST:CONTAINER[:ro], comma-separated).

    DESCRIPTION: Extra bind mounts (HOST:CONTAINER[:ro], comma-separated).

  • MCP_SANDBOX_IMAGEDESCRIPTION: Container image used when sandboxing MCP servers.

    DESCRIPTION: Container image used when sandboxing MCP servers.

  • MCP_SANDBOX_MEMORY_LIMIT512mDESCRIPTION: Container memory limit.

    DESCRIPTION: Container memory limit.

  • MCP_SANDBOX_MOUNT_WORKSPACEtrueDESCRIPTION: Mount the host workspace into the container. Values: true | false

    DESCRIPTION: Mount the host workspace into the container. Values: true | false

  • MCP_SANDBOX_NETWORK_MODEnoneDESCRIPTION: Docker network mode. Values: none | bridge | host | <custom>

    DESCRIPTION: Docker network mode. Values: none | bridge | host | <custom>

  • MCP_SANDBOX_NO_NEW_PRIVILEGEStrueDESCRIPTION: Set --security-opt no-new-privileges. Values: true | false

    DESCRIPTION: Set --security-opt no-new-privileges. Values: true | false

  • MCP_SANDBOX_PASSTHROUGH_ENVPATH,LANG,LC_ALL,TERM,HOMEDESCRIPTION: Comma-separated env vars to forward into the sandbox.

    DESCRIPTION: Comma-separated env vars to forward into the sandbox.

  • MCP_SANDBOX_PERMISSION_ALLOWDESCRIPTION: Comma-separated tool names always allowed.

    DESCRIPTION: Comma-separated tool names always allowed.

  • MCP_SANDBOX_PERMISSION_DENYDESCRIPTION: Comma-separated tool names always denied.

    DESCRIPTION: Comma-separated tool names always denied.

  • MCP_SANDBOX_PERMISSION_MODEautoDESCRIPTION: How tool permissions are decided. Values: auto | allowlist | denylist | prompt

    DESCRIPTION: How tool permissions are decided. Values: auto | allowlist | denylist | prompt

  • MCP_SANDBOX_PIDS_LIMIT100DESCRIPTION: Max PIDs inside the container.

    DESCRIPTION: Max PIDs inside the container.

  • MCP_SANDBOX_READ_ONLY_ROOTfalseDESCRIPTION: Mount the container root filesystem read-only. Values: true | false

    DESCRIPTION: Mount the container root filesystem read-only. Values: true | false

  • MCP_SANDBOX_REUSE_SESSIONtrueDESCRIPTION: Reuse the same sandbox container across calls within a session. Values: true | false

    DESCRIPTION: Reuse the same sandbox container across calls within a session. Values: true | false

  • MCP_SANDBOX_RUNTIMEdockerDESCRIPTION: Sandbox runtime. Values: docker | podman

    DESCRIPTION: Sandbox runtime. Values: docker | podman

  • MCP_SANDBOX_TIMEOUT_MS20000DESCRIPTION: Timeout for a single MCP tool call (ms).

    DESCRIPTION: Timeout for a single MCP tool call (ms).

  • MCP_SANDBOX_USERDESCRIPTION: Run as this user inside the container.

    DESCRIPTION: Run as this user inside the container.

  • MCP_SERVER_MANIFESTDESCRIPTION: Single MCP servers.json manifest path.

    DESCRIPTION: Single MCP servers.json manifest path.

  • MEMORY_DECAY_ENABLEDtrueDESCRIPTION: Apply time-based decay to memory scores. Values: true | false

    DESCRIPTION: Apply time-based decay to memory scores. Values: true | false

  • MEMORY_DECAY_HALF_LIFE30DESCRIPTION: Half-life for memory decay (days).

    DESCRIPTION: Half-life for memory decay (days).

  • MEMORY_DEDUP_ENABLEDtrueDESCRIPTION: Dedupe memories before injection. Values: true | false

    DESCRIPTION: Dedupe memories before injection. Values: true | false

  • MEMORY_DEDUP_LOOKBACK5DESCRIPTION: Turns of history to scan for dedup.

    DESCRIPTION: Turns of history to scan for dedup.

  • MEMORY_ENABLEDtrueDESCRIPTION: Master switch for the long-term Titans-inspired memory system. Values: true | false

    DESCRIPTION: Master switch for the long-term Titans-inspired memory system. Values: true | false

  • MEMORY_EXTRACTION_ENABLEDtrueDESCRIPTION: Auto-extract memories from turns. Values: true | false

    DESCRIPTION: Auto-extract memories from turns. Values: true | false

  • MEMORY_FORMATcompactDESCRIPTION: Memory rendering format. Values: compact | verbose | json

    DESCRIPTION: Memory rendering format. Values: compact | verbose | json

  • MEMORY_INCLUDE_GLOBALtrueDESCRIPTION: Include cross-session global memories. Values: true | false

    DESCRIPTION: Include cross-session global memories. Values: true | false

  • MEMORY_INJECTION_FORMATsystemDESCRIPTION: How retrieved memories are injected. Values: system | user | assistant

    DESCRIPTION: How retrieved memories are injected. Values: system | user | assistant

  • MEMORY_MAX_AGE_DAYS90DESCRIPTION: Hard cap on memory age (days).

    DESCRIPTION: Hard cap on memory age (days).

  • MEMORY_MAX_COUNT10000DESCRIPTION: Hard cap on total memory count.

    DESCRIPTION: Hard cap on total memory count.

  • MEMORY_RETRIEVAL_LIMIT5DESCRIPTION: Max memories retrieved per request.

    DESCRIPTION: Max memories retrieved per request.

  • MEMORY_SURPRISE_THRESHOLD0.3DESCRIPTION: Surprise threshold above which a turn is written to memory.

    DESCRIPTION: Surprise threshold above which a turn is written to memory.

  • MODEL_DEFAULTDESCRIPTION: Default fallback model name when no tier/provider model is known.

    DESCRIPTION: Default fallback model name when no tier/provider model is known.

  • MODEL_PRICE_OVERRIDESDESCRIPTION: JSON of per-model price overrides for the cost registry. Format: {"model-name":{"input":0.5,"output":1.5}}

    DESCRIPTION: JSON of per-model price overrides for the cost registry. Format: {"model-name":{"input":0.5,"output":1.5}}

  • MODEL_PROVIDERollamaDESCRIPTION: [DEPRECATED legacy knob] primary provider for credential validation. Auto-detected when TIER_* is set. Same allowed values as FALLBACK_PROVIDER plus ollama/llamacpp/lmstudio/vertex/zai/moonshot.

    DESCRIPTION: [DEPRECATED legacy knob] primary provider for credential validation. Auto-detected when TIER_* is set. Same allowed values as FALLBACK_PROVIDER plus ollama/llamacpp/lmstudio/vertex/zai/moonshot.

  • MOONSHOT_API_KEYMoonshot AI (Kimi) DESCRIPTION: Moonshot API key.

    Moonshot AI (Kimi) DESCRIPTION: Moonshot API key.

  • MOONSHOT_ENDPOINThttps://api.moonshot.ai/v1/chat/completionsDESCRIPTION: Moonshot chat completions endpoint.

    DESCRIPTION: Moonshot chat completions endpoint.

  • MOONSHOT_MODELkimi-k2-thinkingDESCRIPTION: Default Moonshot model.

    DESCRIPTION: Default Moonshot model.

  • NODE_ENVproductionDESCRIPTION: Node runtime mode. "development" enables pino-pretty (requires install). Values: development | production | test

    DESCRIPTION: Node runtime mode. "development" enables pino-pretty (requires install). Values: development | production | test

  • OLLAMA_EMBEDDINGS_ENDPOINThttp://localhost:11434/api/embeddingsDESCRIPTION: Embeddings endpoint URL.

    DESCRIPTION: Embeddings endpoint URL.

  • OLLAMA_EMBEDDINGS_MODELnomic-embed-textDESCRIPTION: Embedding model (for semantic cache and Cursor @Codebase).

    DESCRIPTION: Embedding model (for semantic cache and Cursor @Codebase).

  • OLLAMA_ENDPOINThttp://localhost:11434DESCRIPTION: Ollama server endpoint.

    DESCRIPTION: Ollama server endpoint.

  • OLLAMA_KEEP_ALIVEDESCRIPTION: Ollama `keep_alive` parameter (e.g. "5m", "30m", "-1" for forever).

    DESCRIPTION: Ollama `keep_alive` parameter (e.g. "5m", "30m", "-1" for forever).

  • OLLAMA_MAX_TOOLS_FOR_ROUTING3DESCRIPTION: Cap on how many tools are injected when routing through Ollama.

    DESCRIPTION: Cap on how many tools are injected when routing through Ollama.

  • OLLAMA_MODELqwen2.5-coder:latestOllama (local models) DESCRIPTION: Default Ollama model id.

    Ollama (local models) DESCRIPTION: Default Ollama model id.

  • OLLAMA_TIMEOUT_MS120000DESCRIPTION: Per-request timeout in milliseconds.

    DESCRIPTION: Per-request timeout in milliseconds.

  • OPENAI_API_KEYOpenAI (direct) DESCRIPTION: OpenAI API key.

    OpenAI (direct) DESCRIPTION: OpenAI API key.

  • OPENAI_ENDPOINThttps://api.openai.com/v1/chat/completionsDESCRIPTION: Chat completions endpoint (can point at any OpenAI-compatible host).

    DESCRIPTION: Chat completions endpoint (can point at any OpenAI-compatible host).

  • OPENAI_MODELgpt-4oDESCRIPTION: Default OpenAI model.

    DESCRIPTION: Default OpenAI model.

  • OPENAI_ORGANIZATIONDESCRIPTION: Optional OpenAI org id.

    DESCRIPTION: Optional OpenAI org id.

  • OPENAI_REASONING_EFFORTFIREWORKS_THINKING_MODELS=glm-5p3|glm-5\.3|deepseek-v4p1-flash # regex: never send thinking:disabled FIREWORKS_RESPONSE_FORMAT_SCHEMA=false # Fireworks rejects json_schema with $ref; json_object by default

    FIREWORKS_THINKING_MODELS=glm-5p3|glm-5\.3|deepseek-v4p1-flash # regex: never send thinking:disabled FIREWORKS_RESPONSE_FORMAT_SCHEMA=false # Fireworks rejects json_schema with $ref; json_object by default

  • OPENAI_RESPONSE_FORMAT_SCHEMA
  • OPENCLAW_MODEDESCRIPTION: OpenClaw mode — rewrites response `model` field with actual provider/model used. Values: true | false

    DESCRIPTION: OpenClaw mode — rewrites response `model` field with actual provider/model used. Values: true | false

  • OPENROUTER_ALLOW_FALLBACKS
  • OPENROUTER_API_KEYOpenRouter (100+ models via single API) DESCRIPTION: OpenRouter API key.

    OpenRouter (100+ models via single API) DESCRIPTION: OpenRouter API key.

  • OPENROUTER_EMBEDDINGS_MODELopenai/text-embedding-ada-002DESCRIPTION: Embedding model used through OpenRouter.

    DESCRIPTION: Embedding model used through OpenRouter.

  • OPENROUTER_ENDPOINThttps://openrouter.ai/api/v1/chat/completionsDESCRIPTION: OpenRouter chat completions endpoint.

    DESCRIPTION: OpenRouter chat completions endpoint.

  • OPENROUTER_MAX_TOKENS_MAPPer-model output cap (bounds runaway reasoning on cheap models).

    Per-model output cap (bounds runaway reasoning on cheap models).

  • OPENROUTER_MAX_TOOLS_FOR_ROUTING15DESCRIPTION: Cap on tool count sent during routing.

    DESCRIPTION: Cap on tool count sent during routing.

  • OPENROUTER_MODELopenai/gpt-4o-miniDESCRIPTION: Default OpenRouter model.

    DESCRIPTION: Default OpenRouter model.

  • OPENROUTER_PROVIDER_ORDEROpenRouter: provider pin, reasoning, schema, timeouts, failover Pin provider(s) globally, or per model (';' between models, ',' between providers).

    OpenRouter: provider pin, reasoning, schema, timeouts, failover Pin provider(s) globally, or per model (';' between models, ',' between providers).

  • OPENROUTER_PROVIDER_ORDER_MAP
  • OPENROUTER_REASONING_EFFORTReasoning effort (global default, or per model).

    Reasoning effort (global default, or per model).

  • OPENROUTER_REASONING_EFFORT_MAP
  • OPENROUTER_RESPONSE_FORMAT_SCHEMA
  • OPENROUTER_SCHEMA_PROVIDERSHosts that honour strict json_schema; others receive json_object.

    Hosts that honour strict json_schema; others receive json_object.

  • OPENROUTER_TIMEOUT_MSUpstream timeout (ms), global and per model; on timeout/5xx/404 Lynkr fails over to the next pinned provider, then lets tier-fallback climb.

    Upstream timeout (ms), global and per model; on timeout/5xx/404 Lynkr fails over to the next pinned provider, then lets tier-fallback climb.

  • OPENROUTER_TIMEOUT_MS_MAP
  • ORCA_API_BASE_URLDESCRIPTION: Explicit API origin override (api.orcarouter.ai default).

    DESCRIPTION: Explicit API origin override (api.orcarouter.ai default).

  • ORCA_AUTH_BASE_URLDESCRIPTION: Explicit auth origin override (www.orcarouter.ai default).

    DESCRIPTION: Explicit auth origin override (www.orcarouter.ai default).

  • ORCA_BASE_URLDESCRIPTION: Shared self-hosted base URL — falls back for BOTH auth and API when the explicit overrides below are unset.

    DESCRIPTION: Shared self-hosted base URL — falls back for BOTH auth and API when the explicit overrides below are unset.

  • ORCAROUTER_API_KEYOrcaRouter (OpenAI-compatible gateway — adaptive routing, failover, zero-markup inference, agent-tool governance) DESCRIPTION: OrcaRouter API key (sk-orca-...). You can also run `lynkr connect orcarouter` for an OAuth 2.0 + PKCE one-click login that issues a key belonging to your own account (no client secret, no redirect pre-registration). Auth requests go to www.orcarouter.ai; inference and mode

    OrcaRouter (OpenAI-compatible gateway — adaptive routing, failover, zero-markup inference, agent-tool governance) DESCRIPTION: OrcaRouter API key (sk-orca-...). You can also run `lynkr connect orcarouter` for an OAuth 2.0 + PKCE one-click login that issues a key belonging to your own account (no client secret, no redirect pre-registration). Auth requests go to www.orcarouter.ai; inference and mode

  • ORCAROUTER_ENDPOINThttps://api.orcarouter.ai/v1/chat/completionsDESCRIPTION: Chat completions endpoint. Defaults to the API origin + /v1.

    DESCRIPTION: Chat completions endpoint. Defaults to the API origin + /v1.

  • ORCAROUTER_MODELorcarouter/autoDESCRIPTION: Default OrcaRouter model (see the live catalog at https://api.orcarouter.ai/v1/models for your workspace's real list).

    DESCRIPTION: Default OrcaRouter model (see the live catalog at https://api.orcarouter.ai/v1/models for your workspace's real list).

  • OVERSIZED_ERROR_LOG_DIR./logs/oversized-errorsDESCRIPTION: Where oversized-error dumps go.

    DESCRIPTION: Where oversized-error dumps go.

  • OVERSIZED_ERROR_LOGGING_ENABLEDtrueDESCRIPTION: Persist oversized-payload errors to disk. Values: true | false

    DESCRIPTION: Persist oversized-payload errors to disk. Values: true | false

  • OVERSIZED_ERROR_MAX_FILES100DESCRIPTION: Max retained oversized-error dump files.

    DESCRIPTION: Max retained oversized-error dump files.

  • OVERSIZED_ERROR_THRESHOLD200DESCRIPTION: Bytes above which a payload is considered "oversized".

    DESCRIPTION: Bytes above which a payload is considered "oversized".

  • PERF_TIMERDESCRIPTION: Print per-stage timing breakdowns to stdout. Values: true | false

    DESCRIPTION: Print per-stage timing breakdowns to stdout. Values: true | false

  • POLICY_DISALLOWED_TOOLSDESCRIPTION: Comma-separated tool names that are never allowed.

    DESCRIPTION: Comma-separated tool names that are never allowed.

  • POLICY_FILE_ALLOWED_PATHSDESCRIPTION: Comma-separated paths that file tools may touch (allowlist).

    DESCRIPTION: Comma-separated paths that file tools may touch (allowlist).

  • POLICY_FILE_BLOCKED_PATHS/.env,.env,/etc/passwd,/etc/shadowDESCRIPTION: Comma-separated paths that file tools may NOT touch.

    DESCRIPTION: Comma-separated paths that file tools may NOT touch.

  • POLICY_GIT_ALLOW_COMMITtrueDESCRIPTION: Allow `git commit`. Values: true | false

    DESCRIPTION: Allow `git commit`. Values: true | false

  • POLICY_GIT_ALLOW_PULLtrueDESCRIPTION: Allow `git pull`. Values: true | false

    DESCRIPTION: Allow `git pull`. Values: true | false

  • POLICY_GIT_ALLOW_PUSHfalseDESCRIPTION: Allow `git push`. Values: true | false

    DESCRIPTION: Allow `git push`. Values: true | false

  • POLICY_GIT_AUTOSTASHDESCRIPTION: Auto-stash uncommitted changes before risky git operations. Values: true | false

    DESCRIPTION: Auto-stash uncommitted changes before risky git operations. Values: true | false

  • POLICY_GIT_COMMIT_REGEXDESCRIPTION: Regex that commit messages must match.

    DESCRIPTION: Regex that commit messages must match.

  • POLICY_GIT_REQUIRE_TESTSfalseDESCRIPTION: Refuse commits unless POLICY_GIT_TEST_COMMAND passes. Values: true | false

    DESCRIPTION: Refuse commits unless POLICY_GIT_TEST_COMMAND passes. Values: true | false

  • POLICY_GIT_TEST_COMMANDDESCRIPTION: Test command run before allowing a commit (when REQUIRE_TESTS=true).

    DESCRIPTION: Test command run before allowing a commit (when REQUIRE_TESTS=true).

  • POLICY_MAX_STEPS20DESCRIPTION: Hard cap on routing/tool-call steps per request.

    DESCRIPTION: Hard cap on routing/tool-call steps per request.

  • POLICY_MAX_TOOL_CALLS12DESCRIPTION: Hard cap on tool calls per request.

    DESCRIPTION: Hard cap on tool calls per request.

  • POLICY_SAFE_COMMANDS_CONFIGDESCRIPTION: JSON config for the safe-commands allowlist.

    DESCRIPTION: JSON config for the safe-commands allowlist.

  • POLICY_SAFE_COMMANDS_ENABLEDtrueDESCRIPTION: Apply the safe-commands allowlist to bash tool calls. Values: true | false

    DESCRIPTION: Apply the safe-commands allowlist to bash tool calls. Values: true | false

  • POLICY_TOOL_LOOP_THRESHOLD10DESCRIPTION: Force-terminate after this many same-tool calls in a row (loop guard).

    DESCRIPTION: Force-terminate after this many same-tool calls in a row (loop guard).

  • PORT8080DESCRIPTION: HTTP port the proxy listens on.

    DESCRIPTION: HTTP port the proxy listens on.

  • PREFER_OLLAMADESCRIPTION: [DEPRECATED] legacy preference for Ollama. Use TIER_SIMPLE=ollama:<model> instead. Values: true | false

    DESCRIPTION: [DEPRECATED] legacy preference for Ollama. Use TIER_SIMPLE=ollama:<model> instead. Values: true | false

  • PROMPT_CACHE_ENABLEDtrueDESCRIPTION: Master switch for the in-memory prompt cache. Values: true | false

    DESCRIPTION: Master switch for the in-memory prompt cache. Values: true | false

  • PROMPT_CACHE_MAX_ENTRIES1000DESCRIPTION: Max number of prompts to cache.

    DESCRIPTION: Max number of prompts to cache.

  • PROMPT_CACHE_TTL_MS300000DESCRIPTION: Cache entry TTL (ms).

    DESCRIPTION: Cache entry TTL (ms).

  • RATE_LIMIT_ENABLEDtrueDESCRIPTION: Master switch for the per-session rate limiter. Values: true | false

    DESCRIPTION: Master switch for the per-session rate limiter. Values: true | false

  • RATE_LIMIT_KEY_BYDESCRIPTION: How requests are bucketed. Values: session | ip | both

    DESCRIPTION: How requests are bucketed. Values: session | ip | both

  • RATE_LIMIT_MAX100DESCRIPTION: Max requests per window.

    DESCRIPTION: Max requests per window.

  • RATE_LIMIT_WINDOW_MS60000DESCRIPTION: Sliding window length (ms).

    DESCRIPTION: Sliding window length (ms).

  • REQUEST_JSON_LIMIT1gbDESCRIPTION: Max JSON request body size (express bodyParser units, e.g. "1gb").

    DESCRIPTION: Max JSON request body size (express bodyParser units, e.g. "1gb").

  • RISK_TIER_ESCALATIONDisable security-keyword risk escalation (tasks ABOUT security are not risky).

    Disable security-keyword risk escalation (tasks ABOUT security are not risky).

  • SECURITY_AUDIT_LOG_DIR./logsDESCRIPTION: Directory for the security audit log.

    DESCRIPTION: Directory for the security audit log.

  • SECURITY_AUDIT_LOG_ENABLEDtrueDESCRIPTION: Persist security events to disk. Values: true | false

    DESCRIPTION: Persist security events to disk. Values: true | false

  • SECURITY_BLOCK_ON_DETECTIONtrueDESCRIPTION: Block requests when the filter triggers (vs. just log). Values: true | false

    DESCRIPTION: Block requests when the filter triggers (vs. just log). Values: true | false

  • SECURITY_CONTENT_FILTER_ENABLEDtrueDESCRIPTION: Master switch for the security content filter. Values: true | false

    DESCRIPTION: Master switch for the security content filter. Values: true | false

  • SECURITY_PER_ENDPOINT_LIMIT1000DESCRIPTION: Per-endpoint request cap per minute.

    DESCRIPTION: Per-endpoint request cap per minute.

  • SECURITY_PER_IP_LIMIT100DESCRIPTION: Per-IP request cap per minute.

    DESCRIPTION: Per-IP request cap per minute.

  • SECURITY_RATE_LIMIT_ENABLEDtrueDESCRIPTION: Master switch for the security rate limiter. Values: true | false

    DESCRIPTION: Master switch for the security rate limiter. Values: true | false

  • SEMANTIC_CACHE_ENABLEDtrueDESCRIPTION: Master switch for semantic (embedding-based) response cache. Values: true | false

    DESCRIPTION: Master switch for semantic (embedding-based) response cache. Values: true | false

  • SEMANTIC_CACHE_MAX_ENTRIES50DESCRIPTION: Max number of cached entries.

    DESCRIPTION: Max number of cached entries.

  • SEMANTIC_CACHE_THRESHOLD0.95DESCRIPTION: Cosine-similarity threshold for a cache hit.

    DESCRIPTION: Cosine-similarity threshold for a cache hit.

  • SEMANTIC_CACHE_TTL_MS300000DESCRIPTION: Cache entry TTL (ms).

    DESCRIPTION: Cache entry TTL (ms).

  • SESSION_DB_PATH./data/sessions.dbDESCRIPTION: SQLite path for session storage.

    DESCRIPTION: SQLite path for session storage.

  • SMART_TOOL_SELECTION_MODEheuristicDESCRIPTION: Smart tool selection strategy (also feeds the routing complexity analyzer). Values: heuristic | aggressive | conservative | disabled

    DESCRIPTION: Smart tool selection strategy (also feeds the routing complexity analyzer). Values: heuristic | aggressive | conservative | disabled

  • SMART_TOOL_SELECTION_TOKEN_BUDGETDESCRIPTION: Token budget the smart-selector tries to stay under.

    DESCRIPTION: Token budget the smart-selector tries to stay under.

  • SUGGESTION_MODE_MODELdefaultDESCRIPTION: Suggestion-mode model override. Values: default (same as MODEL_PROVIDER) | none | <model-name>

    DESCRIPTION: Suggestion-mode model override. Values: default (same as MODEL_PROVIDER) | none | <model-name>

  • SYSTEM_PROMPT_MODEdynamicDESCRIPTION: System prompt rendering strategy. Values: dynamic | static | minimal

    DESCRIPTION: System prompt rendering strategy. Values: dynamic | static | minimal

  • TENCENTDB_MEMORY_CORE_PORTDESCRIPTION: Host port overrides (defaults shown).

    DESCRIPTION: Host port overrides (defaults shown).

  • TENCENTDB_MEMORY_DOCKER_ENABLEDDESCRIPTION: Let Lynkr manage the containers. Set false if you run the stack yourself via the project's deploy scripts. Values: true | false

    DESCRIPTION: Let Lynkr manage the containers. Set false if you run the stack yourself via the project's deploy scripts. Values: true | false

  • TENCENTDB_MEMORY_ENABLEDtrueDESCRIPTION: TencentDB-Agent-Memory sidecar (team memory hub: L0-L3 chat memory, Skills, Wiki, CodeGraph). When enabled, `lynkr start` launches the memory-core + memory-hub containers from Docker Hub (agentmemory/*) — same pattern as the Headroom sidecar. Panel UI: http://localhost:8125 Requires Docker (skips gracefully if unavailable). Containers persist across Lynkr restarts (remove with: docker

    DESCRIPTION: TencentDB-Agent-Memory sidecar (team memory hub: L0-L3 chat memory, Skills, Wiki, CodeGraph). When enabled, `lynkr start` launches the memory-core + memory-hub containers from Docker Hub (agentmemory/*) — same pattern as the Headroom sidecar. Panel UI: http://localhost:8125 Requires Docker (skips gracefully if unavailable). Containers persist across Lynkr restarts (remove with: docker

  • TENCENTDB_MEMORY_KNOWLEDGE_PORT
  • TENCENTDB_MEMORY_LLM_API_KEY
  • TENCENTDB_MEMORY_LLM_BASE_URLDESCRIPTION: LLM endpoint the memory services use for extraction and wiki ingest. Defaults to Lynkr's own OpenAI-compatible endpoint (tier routing picks the model), so no extra API key is needed. Override to point at a provider directly.

    DESCRIPTION: LLM endpoint the memory services use for extraction and wiki ingest. Defaults to Lynkr's own OpenAI-compatible endpoint (tier routing picks the model), so no extra API key is needed. Override to point at a provider directly.

  • TENCENTDB_MEMORY_LLM_MODEL
  • TENCENTDB_MEMORY_PANEL_PORT
  • TENCENTDB_MEMORY_PROMPT_MODEDESCRIPTION: Memory extraction style. `code` extracts changes/issues/tool usage (coding agents); `chat` extracts general conversational facts. Values: code | chat

    DESCRIPTION: Memory extraction style. `code` extracts changes/issues/tool usage (coding agents); `chat` extracts general conversational facts. Values: code | chat

  • TIER_COMPLEXDESCRIPTION: Provider:model for complex tasks (multi-file changes, design)

    DESCRIPTION: Provider:model for complex tasks (multi-file changes, design)

  • TIER_MEDIUMollama:qwen2.5-coder:latestDESCRIPTION: Provider:model for moderate tasks (code edits, small refactors)

    DESCRIPTION: Provider:model for moderate tasks (code edits, small refactors)

  • TIER_REASONINGmoonshot:kimi-k2-thinkingDESCRIPTION: Provider:model for hard reasoning (algorithms, debugging)

    DESCRIPTION: Provider:model for hard reasoning (algorithms, debugging)

  • TIER_SIMPLEollama:qwen2.5-coder:latestDESCRIPTION: Provider:model for trivial single-shot tasks (greetings, formatting)

    DESCRIPTION: Provider:model for trivial single-shot tasks (greetings, formatting)

  • TINYFISH_API_KEYDESCRIPTION: TinyFish.ai API key (enables the WebAgent browser-automation tool).

    DESCRIPTION: TinyFish.ai API key (enables the WebAgent browser-automation tool).

  • TINYFISH_BROWSER_PROFILEliteDESCRIPTION: Browser profile preset. Values: lite | standard | stealth

    DESCRIPTION: Browser profile preset. Values: lite | standard | stealth

  • TINYFISH_ENDPOINThttps://agent.tinyfish.ai/v1/automation/run-sseDESCRIPTION: TinyFish automation endpoint.

    DESCRIPTION: TinyFish automation endpoint.

  • TINYFISH_PROXY_COUNTRYUSDESCRIPTION: Proxy egress country (ISO 3166 alpha-2).

    DESCRIPTION: Proxy egress country (ISO 3166 alpha-2).

  • TINYFISH_PROXY_ENABLEDfalseDESCRIPTION: Route the browser through a residential proxy. Values: true | false

    DESCRIPTION: Route the browser through a residential proxy. Values: true | false

  • TINYFISH_TIMEOUT_MS120000DESCRIPTION: Per-run timeout (ms).

    DESCRIPTION: Per-run timeout (ms).

  • TOKEN_BUDGET_ENFORCEMENTDESCRIPTION: Apply adaptive compression when a request exceeds the budget (instead of only warning). Requests are compressed to fit, not refused. Values: true | false

    DESCRIPTION: Apply adaptive compression when a request exceeds the budget (instead of only warning). Requests are compressed to fit, not refused. Values: true | false

  • TOKEN_BUDGET_MAXDESCRIPTION: OPT-IN global request-size ceiling (tokens). LEAVE UNSET for the default behavior: the budget is derived automatically from the SERVED model's real context window (registry window × 0.85, pin-aware behind virtual model names) — a 128k model gets a 108k budget, a 1M model gets an 850k budget. Set this ONLY as a deliberate cost/latency ceiling: input tokens are re-billed every turn, so

    DESCRIPTION: OPT-IN global request-size ceiling (tokens). LEAVE UNSET for the default behavior: the budget is derived automatically from the SERVED model's real context window (registry window × 0.85, pin-aware behind virtual model names) — a 128k model gets a 108k budget, a 1M model gets an 850k budget. Set this ONLY as a deliberate cost/latency ceiling: input tokens are re-billed every turn, so

  • TOKEN_BUDGET_WARNINGDESCRIPTION: Token budget that triggers a "you're approaching the limit" warning.

    DESCRIPTION: Token budget that triggers a "you're approaching the limit" warning.

  • TOKEN_TRACKING_ENABLEDDESCRIPTION: Track input/output tokens per request. Values: true | false

    DESCRIPTION: Track input/output tokens per request. Values: true | false

  • TOOL_DESCRIPTIONSminimalDESCRIPTION: How verbose tool descriptions are. Values: minimal | normal | verbose

    DESCRIPTION: How verbose tool descriptions are. Values: minimal | normal | verbose

  • TOON_ENABLEDDESCRIPTION: Enable TOON (token-optimized object notation) encoding for large structured payloads. Values: true | false

    DESCRIPTION: Enable TOON (token-optimized object notation) encoding for large structured payloads. Values: true | false

  • TOON_FAIL_OPENtrueDESCRIPTION: Continue without TOON on encoder failure instead of erroring. Values: true | false

    DESCRIPTION: Continue without TOON on encoder failure instead of erroring. Values: true | false

  • TOON_LOG_STATStrueDESCRIPTION: Log per-request TOON savings stats. Values: true | false

    DESCRIPTION: Log per-request TOON savings stats. Values: true | false

  • TOON_MIN_BYTES4096DESCRIPTION: Minimum byte size before TOON encoding kicks in.

    DESCRIPTION: Minimum byte size before TOON encoding kicks in.

  • TYPESAFE_API_KEYDESCRIPTION: TypeSafe API key for the Jev routing judge (second opinion on intent difficulty + risk corroboration). Optional — anchor scoring carries routing alone when unset (fail-soft null, no new env vars otherwise).

    DESCRIPTION: TypeSafe API key for the Jev routing judge (second opinion on intent difficulty + risk corroboration). Optional — anchor scoring carries routing alone when unset (fail-soft null, no new env vars otherwise).

  • VERTEX_API_KEYGoogle Vertex AI / Gemini DESCRIPTION: Vertex/Gemini API key (preferred name).

    Google Vertex AI / Gemini DESCRIPTION: Vertex/Gemini API key (preferred name).

  • VERTEX_MODELgemini-2.0-flashDESCRIPTION: Default Gemini model.

    DESCRIPTION: Default Gemini model.

  • WEB_FETCH_BODY_PREVIEW_MAX10000DESCRIPTION: Max bytes of page body shown in WebFetch results.

    DESCRIPTION: Max bytes of page body shown in WebFetch results.

  • WEB_SEARCH_ALLOW_ALLtrueDESCRIPTION: Allow searching any host (overrides the allowlist). Values: true | false

    DESCRIPTION: Allow searching any host (overrides the allowlist). Values: true | false

  • WEB_SEARCH_ALLOWED_HOSTSDESCRIPTION: Comma-separated allowlist of search hosts.

    DESCRIPTION: Comma-separated allowlist of search hosts.

  • WEB_SEARCH_API_KEYDESCRIPTION: Bearer token for the search endpoint.

    DESCRIPTION: Bearer token for the search endpoint.

  • WEB_SEARCH_ENDPOINThttp://localhost:8888/searchDESCRIPTION: Endpoint for the WebSearch tool (often a local SearXNG instance).

    DESCRIPTION: Endpoint for the WebSearch tool (often a local SearXNG instance).

  • WEB_SEARCH_MAX_RETRIES2DESCRIPTION: Max retry attempts on failure.

    DESCRIPTION: Max retry attempts on failure.

  • WEB_SEARCH_RETRY_ENABLEDtrueDESCRIPTION: Retry failed searches. Values: true | false

    DESCRIPTION: Retry failed searches. Values: true | false

  • WEB_SEARCH_TIMEOUT_MS10000DESCRIPTION: Per-search timeout (ms).

    DESCRIPTION: Per-search timeout (ms).

  • WORKER_OFFLOAD_THRESHOLD_BYTES10000DESCRIPTION: Payload size (bytes) above which work is offloaded to the pool.

    DESCRIPTION: Payload size (bytes) above which work is offloaded to the pool.

  • WORKER_POOL_ENABLEDtrueDESCRIPTION: Master switch for the worker thread pool (heavy parsing, embeddings). Values: true | false

    DESCRIPTION: Master switch for the worker thread pool (heavy parsing, embeddings). Values: true | false

  • WORKER_POOL_SIZE0DESCRIPTION: Worker pool size. 0 = auto (CPU cores - 1).

    DESCRIPTION: Worker pool size. 0 = auto (CPU cores - 1).

  • WORKER_TASK_TIMEOUT_MS5000DESCRIPTION: Per-task timeout (ms).

    DESCRIPTION: Per-task timeout (ms).

  • WORKSPACE_ROOT/path/to/your/workspaceDESCRIPTION: Absolute path to the workspace Lynkr operates on.

    DESCRIPTION: Absolute path to the workspace Lynkr operates on.

  • WORKSPACE_TEST_ARGSDESCRIPTION: Extra args appended to the test command.

    DESCRIPTION: Extra args appended to the test command.

  • WORKSPACE_TEST_COMMANDDESCRIPTION: Test command the workspace runner invokes.

    DESCRIPTION: Test command the workspace runner invokes.

  • WORKSPACE_TEST_COVERAGE_FILEScoverage/coverage-summary.jsonDESCRIPTION: Coverage report paths the runner picks up.

    DESCRIPTION: Coverage report paths the runner picks up.

  • WORKSPACE_TEST_PROFILESDESCRIPTION: JSON array of named test profiles.

    DESCRIPTION: JSON array of named test profiles.

  • WORKSPACE_TEST_SANDBOXautoDESCRIPTION: How tests are sandboxed. Values: auto | docker | none

    DESCRIPTION: How tests are sandboxed. Values: auto | docker | none

  • WORKSPACE_TEST_TIMEOUT_MS600000DESCRIPTION: Test timeout (ms).

    DESCRIPTION: Test timeout (ms).

  • ZAI_API_KEYZ.AI (Zhipu AI) DESCRIPTION: Z.AI API key.

    Z.AI (Zhipu AI) DESCRIPTION: Z.AI API key.

  • ZAI_ENDPOINThttps://api.z.ai/api/anthropic/v1/messagesDESCRIPTION: Z.AI Anthropic-compatible messages endpoint.

    DESCRIPTION: Z.AI Anthropic-compatible messages endpoint.

  • ZAI_MAX_CONCURRENT2DESCRIPTION: Max concurrent in-flight Z.AI requests.

    DESCRIPTION: Max concurrent in-flight Z.AI requests.

  • ZAI_MODELGLM-4.7DESCRIPTION: Default Z.AI model.

    DESCRIPTION: Default Z.AI model.

FAQ

Can I run Lynkr completely offline?

Yes — use local providers such as Ollama or llama.cpp for chat and embeddings, which keeps all data on your machine.

What metrics does Lynkr collect?

Request rate, latency percentiles, error and token/cost metrics plus memory, CPU, connection and circuit-breaker state, exposed in Prometheus format at /metrics.

How do I deploy with Docker?

Clone the repo, copy .env.example to .env with your credentials and run docker-compose up -d, or build and run the lynkr image standalone.

Where do tools execute?

Always on the client machine; Lynkr only forwards tool_use blocks and returns results with the next request.

Does Lynkr support MCP (Model Context Protocol)?

Yes: it discovers manifests in ~/.claude/mcp, speaks JSON-RPC 2.0 to MCP servers, registers their tools dynamically and can sandbox them in Docker.

What is token optimization and how does it save costs?

Five phases — prompt caching, memory deduplication, tool-response truncation, dynamic system prompts and conversation compression — cut provider costs by a claimed 60-80%.

What is FALLBACK_PROVIDER?

A cloud provider Lynkr transparently retries against when the tier-selected provider fails; it cannot be a local provider and defaults to databricks.

What happens if I only set some TIER_* vars?

All four tier variables must be set; otherwise tier routing is disabled entirely and MODEL_PROVIDER handles every request.

How do I install Lynkr?

Globally via npm (`npm install -g lynkr` then `lynkr start`), through the Homebrew tap, or by cloning the repo and running npm start.

What's the difference between Lynkr and native Claude Code?

Native Claude Code only reaches Anthropic's cloud at full price, while Lynkr adds 12+ providers, local models, token optimization and cost tracking.

How much does Lynkr cost?

Nothing — it is free and open source under Apache 2.0; you only pay your chosen model provider.

Does Lynkr work with Cursor IDE?

Yes, through its OpenAI-compatible endpoint: set Cursor's base URL to http://localhost:8081/v1 and any non-empty API key.

What is Lynkr?

A self-hosted proxy server that lets Claude Code CLI and Cursor IDE talk to many LLM providers instead of being locked to Anthropic's API.

More in API Gateway

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…