Onex
Onex
Home
Products
Documentation
Changelog
Login with FiveM
  • 👋 Welcome
  • Claim Purchase
  • Translations
    • Weaponmeta
    • Voice Interaction
      Integrations
      Installation
      ⭐ Convars
      Stt-setup
      Tts-setup
      Configuration
      Features
      Api
Artifacts Tracker
  1. Onex Scripts
  2. Scripts_guides / Llm Setup
Ctrl K

LLM SETUP#

LLM (Large Language Model) integration is fully optional. Without a key the script works normally with fuzzy matching. With a key, two additional capabilities unlock.

What the LLM Key Enables#

Config OptionWhat it Does
Config.LLM.enableMatchingLLMTier 4 fallback — when all fuzzy matching fails, LLM attempts to interpret the player's intent
Config.LLM.enableAddonLLMAllows addons (e.g. Ambient NPC) to generate unique AI-powered responses
Config.LLM.prioritizeMatchingLLMRuns LLM matching first, before fuzzy tiers (not recommended for most servers)

These options are set in shared/config.lua but only activate if a valid LLM key is registered at startup.

Providers#

Groq is the recommended LLM provider. It has a free tier and low latency. If you already set stt_api_key with stt_provider "groq", the same key is automatically reused for LLM — no separate llm_api_key is needed.

Get a Groq API key#

Create a free account at console.groq.com and generate an API key.

Add to server.cfg#

set llm_api_key "your_groq_api_key_here" set llm_provider "groq" ensure [onex]

Enable LLM in config.lua#

Config.LLM = { enableAddonLLM = true, enableMatchingLLM = true, prioritizeMatchingLLM = false, matchingMode = "fallback", -- "fallback" | "parallel" }

Key Reuse#

If you use Groq for STT, the same key is automatically reused for LLM. You do not need to set both stt_api_key and llm_api_key when both point to Groq.

Priority chain for LLM key resolution:

  1. llm_api_key (explicit, any provider)
  2. groq_api_key (deprecated fallback)
  3. stt_api_key when stt_provider = "groq" (automatic reuse)

Config.LLM Options#

FieldDefaultDescription
enableAddonLLMtrueAllow addons (ambient_npc, etc.) to use LLM for responses
enableMatchingLLMtrueAllow Tier 4 LLM matching when fuzzy matching fails
prioritizeMatchingLLMfalseRun LLM matching first, before Tiers 1–3
matchingMode"fallback""fallback" — LLM only when other tiers fail; "parallel" — LLM runs alongside

Verification#

After restarting the server with a key configured, check the server console. A successful registration logs a 200 response with a provider confirmation. Common errors:

ResponseCause
200Key valid and registered
401Key rejected — verify no leading/trailing spaces
0 / timeoutNo internet or backend unreachable

Never share or commit your API keys to version control. Set them as convars in server.cfg and ensure that file is excluded from any public repositories.

Deprecation Notice#

groq_api_key is deprecated. It still works as an LLM fallback but will be removed in a future version. Migrate to llm_api_key + llm_provider "groq".

Last updated 3 months ago

Quick Links

All DocumentationOur Products