Skip to content
Start in Cloud

AI Model Configuration

HitKeep can use an optional AI model for features that need structured summarization or recommendation copy. The first feature is Opportunity Recommendations.

AI is off by default. HitKeep Cloud manages the model route for cloud customers. Self-hosted operators choose the HitKeep provider/model route and local budget settings through HITKEEP_AI_* variables. Provider credentials are resolved by the wrapped goAI provider, so set the provider’s own environment variables for keys, base URLs, or platform credentials unless you are using a HitKeep-specific override.

For Opportunity Recommendations, HitKeep does not ask the model to discover facts from scratch. HitKeep reads aggregate analytics first, runs deterministic detectors, and then asks the model for a small structured response.

The model may choose:

  • approved title, summary, action, and digest translation keys
  • allowed interpolation params for those keys
  • cited evidence IDs from the detector output
  • small metadata fields such as action type and effort

The model may not create new evidence, make unsupported source claims, write free-form customer prose, expose raw prompts, or add financial promises. HitKeep validates the structured response before saving it.

DeploymentWho configures the modelWhat the customer sees
HitKeep CloudHitKeep operates the provider/model route and budget policy.System Status can show non-secret state, provider/model labels when exposed, usage, caps, and safe error categories.
Self-hostedThe instance operator sets the HitKeep route/budget fields and the selected goAI provider’s credential environment.The same System Status fields are available without exposing secrets.
AI disabledNo provider call is made.Detector-backed Opportunities can still be generated when the feature has enough aggregate evidence.

Choose a model for reliable structured output, not marketing copy. A good model route for HitKeep should be fast, cost-controlled, and strong at JSON schema following.

Useful model traits:

  • supports structured output or consistently returns valid JSON
  • handles short analytical instructions without adding prose
  • has enough context for aggregate evidence snapshots
  • reports token usage when possible
  • has latency and cost that fit scheduled recommendation generation
  • can be pinned to the deployment region or gateway policy you need

HitKeep does not require one provider. You can use any provider supported by the HitKeep goAI wrapper, an OpenAI-compatible gateway, a region-scoped provider, or a local model if it can pass validation.

Set these on the HitKeep process. Values can also be passed as matching CLI flags. Keep provider secrets in your process manager, container secret store, or cloud secret manager.

Environment variableDefaultRequired whenMeaning
HITKEEP_AI_ENABLEDfalseAlways, to enable AIEnables optional AI-assisted features.
HITKEEP_AI_PROVIDER""AI enabledProvider key used by HitKeep’s goAI wrapper. Common choices include openai, openai-compatible, litellm, bifrost, gateway, anthropic, google, mistral, openrouter, groq, and ollama.
HITKEEP_AI_MODEL""AI enabledProvider-specific model ID or gateway route name.
HITKEEP_AI_BASE_URL""OpenAI-compatible routesGateway or custom endpoint base URL. Required for openai-compatible, compat, gateway, bifrost, and litellm. For direct providers, prefer the provider’s goAI base URL variable such as OPENAI_BASE_URL.
HITKEEP_AI_REGION""Optional overrideRegion override passed to providers that support it. For AWS Bedrock, goAI also reads AWS_REGION or AWS_DEFAULT_REGION.
HITKEEP_AI_API_KEY""Optional overrideStatic token passed to goAI providers that support WithAPIKey or bearer-token options. Prefer provider-native variables such as OPENAI_API_KEY, ANTHROPIC_API_KEY, or OPENROUTER_API_KEY. Redacted in logs and status.
HITKEEP_AI_TIMEOUT_SECONDS30OptionalProvider request timeout.
HITKEEP_AI_REQUEST_LIMIT100OptionalMaximum AI requests per budget window. 0 disables the local request cap.
HITKEEP_AI_TOKEN_LIMIT100000OptionalMaximum counted provider tokens per budget window. 0 disables the local token cap.
HITKEEP_AI_BUDGET_WINDOW1440OptionalBudget window in minutes. The default is one day.

HitKeep does not rename every provider’s credential variables. It builds the selected goAI provider and lets that provider resolve its documented environment variables. Use the goAI supported providers documentation as the source of truth for provider-specific auth variables, base URL overrides, and provider pages.

Common variables are:

ProviderEnvironment variables goAI reads
OpenAIOPENAI_API_KEY, optional OPENAI_BASE_URL
AnthropicANTHROPIC_API_KEY, optional ANTHROPIC_BASE_URL
Google GeminiGOOGLE_GENERATIVE_AI_API_KEY or GEMINI_API_KEY, optional GOOGLE_GENERATIVE_AI_BASE_URL
AWS BedrockAWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN, AWS_REGION or AWS_DEFAULT_REGION, optional AWS_BEARER_TOKEN_BEDROCK and AWS_BEDROCK_BASE_URL
OpenRouterOPENROUTER_API_KEY
MistralMISTRAL_API_KEY, optional MISTRAL_BASE_URL
GroqGROQ_API_KEY
xAIXAI_API_KEY, optional XAI_BASE_URL
CohereCOHERE_API_KEY
DeepSeekDEEPSEEK_API_KEY, optional DEEPSEEK_BASE_URL
FireworksFIREWORKS_API_KEY, optional FIREWORKS_BASE_URL
TogetherTOGETHER_AI_API_KEY or TOGETHER_API_KEY
PerplexityPERPLEXITY_API_KEY
CerebrasCEREBRAS_API_KEY, optional CEREBRAS_BASE_URL

Check the goAI provider documentation for the exact provider you select. If you set HITKEEP_AI_API_KEY, HitKeep passes it as an explicit option and it can override provider env resolution for providers that support static keys.

Use this when HitKeep should call the provider directly. Set the HitKeep route fields plus the provider’s goAI credential environment.

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=openai
HITKEEP_AI_MODEL=your-json-capable-model
OPENAI_API_KEY=provider_key_from_your_secret_store
HITKEEP_AI_REQUEST_LIMIT=100
HITKEEP_AI_TOKEN_LIMIT=100000
HITKEEP_AI_BUDGET_WINDOW=1440

Replace openai and your-json-capable-model with the provider and model you want to use. See the Configuration Reference for the supported provider keys.

Use this when an internal gateway owns routing, provider choice, policy, and billing.

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=openai-compatible
HITKEEP_AI_MODEL=opportunities-json
HITKEEP_AI_BASE_URL=https://ai-gateway.example.com/v1
HITKEEP_AI_REQUEST_LIMIT=100
HITKEEP_AI_TOKEN_LIMIT=100000
HITKEEP_AI_BUDGET_WINDOW=1440

The gateway can route opportunities-json to any model it supports. Authentication is optional for the generic goAI-compatible provider. If your gateway expects a bearer token, set HITKEEP_AI_API_KEY as an explicit gateway token. HitKeep still validates output locally and still enforces its local request and token budgets before provider calls.

Some providers require a region or platform profile. Configure the provider’s own environment first, then set the HitKeep provider/model fields.

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=bedrock
HITKEEP_AI_MODEL=anthropic.claude-3-5-sonnet-20241022-v2:0
AWS_REGION=eu-central-1
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...
HITKEEP_AI_REQUEST_LIMIT=100
HITKEEP_AI_TOKEN_LIMIT=100000
HITKEEP_AI_BUDGET_WINDOW=1440

Use HITKEEP_AI_REGION only when you want HitKeep to pass an explicit region override to a provider that supports it.

Local models are useful for development and offline checks. They are not automatically release-quality for customer-facing recommendations. Use a model that can return strict JSON reliably.

Terminal window
HITKEEP_AI_ENABLED=true
HITKEEP_AI_PROVIDER=ollama
HITKEEP_AI_MODEL=llama3.1
HITKEEP_AI_BASE_URL=http://127.0.0.1:11434

If validation fails, HitKeep keeps detector-backed output and records a safe invalid_output category.

HITKEEP_AI_TOKEN_LIMIT is a local usage budget. It is not the model context window and it is not the per-response output cap.

Three different limits can apply:

LimitOwnerMeaning
Model context windowProvider or gatewayMaximum input plus output size the model can handle.
Provider output capHitKeep request and providerThe current Opportunities enrichment request expects a compact JSON object and asks for at most 900 output tokens.
Local token budgetHitKeepMaximum counted provider tokens per HITKEEP_AI_BUDGET_WINDOW.

Start with a small budget and raise it after System Status shows normal usage.

Use caseSuggested request limitSuggested token limitWindow
Small self-hosted instance20500001440
Medium self-hosted instance1001000001440
Active smoke testing8024000060
Disabled provider callsLeave HITKEEP_AI_ENABLED=falseLeave defaultLeave default

Request limits count provider calls. Token limits count usage reported by the provider or gateway. Some providers may omit token usage for failed calls or tool steps, so keep upstream provider limits as a second guardrail.

Set either local cap to 0 only when another enforced system owns the same limit.

The Administration -> System Status page and /api/admin/system/ai endpoint show non-secret AI status:

  • enabled/configured state
  • provider and model label
  • self_hosted or cloud_managed configuration mode
  • request and token usage in the current budget window
  • cap state, including budget exhaustion
  • last safe success or error category

Status never returns provider secrets, raw prompts, raw provider responses, raw external error bodies, or unrestricted tool output.

AI run records keep the operational facts needed for audit:

  • team, site, actor, and feature
  • provider and model label
  • prompt template version
  • cited evidence IDs
  • input and output hashes
  • final validated structured output
  • request and token usage when available
  • lifecycle events for request and tool start/finish, latency, status, and safe error category

HitKeep does not persist raw prompts or raw provider payloads. For Opportunities, public API, MCP, share links, takeout, and email digests use the saved customer-visible output, not raw model text.

Status or symptomWhat to check
disabledHITKEEP_AI_ENABLED is false or missing. Deterministic Opportunity detectors can still run.
not_configuredProvider/model is missing, provider is unsupported, or an OpenAI-compatible provider is missing HITKEEP_AI_BASE_URL.
budget_exhaustedRaise HITKEEP_AI_REQUEST_LIMIT, raise HITKEEP_AI_TOKEN_LIMIT, shorten the generation window, or wait for the HITKEEP_AI_BUDGET_WINDOW to reset.
auth_failedCheck the selected goAI provider’s environment variables, platform credentials, provider model access, region, and gateway token policy.
rate_limitedLower generation frequency or raise provider/gateway quotas.
timeoutIncrease HITKEEP_AI_TIMEOUT_SECONDS, reduce gateway latency, or use a faster model route.
invalid_outputUse a model with better structured-output support or route through a gateway/model profile tuned for JSON schema compliance.