Peak AI NPC
Peak AI NPC adds server-authoritative conversations to FiveM while keeping core decisions and economy transactions on the server. Configured NPCs are the privileged store, mission, and service roles; eligible networked ambient peds can also be spoken to without placing each ped in advance. Ambient conversations permit only bounded, reversible social actions; economy, inventory, missions, and service tools remain restricted to configured roles. It supports contextual identity/location, scoped player-NPC memory, 3D subtitles, voice dictation, TTS, target integrations, vision, and local or cloud providers.
Open-for-Edit Files (escrow_ignore)
Per Peak Studios release rules, core runtime and network state machines are escrowed while customization files remain completely open for editing:
shared/config.lua: Lore, interaction distance, framework selection, target system, voice limits, subtitle options, vision quality.shared/voice_casting.lua: Ped-to-profile casting, stable variation, and review metadata. New or changed provider voices require operator approval before speech is enabled.npcs/examples.lua: NPC ped definitions, coordinates, behavioral prompts, identities, knowledge constraints, allowed tools.client/targets.lua: Custom interaction registration (ox_target,qb-target, native fallback).locales/*.lua: Subtitle and NUI notification text strings.shared/constants.lua: Event names and state keys.
Usage and failed requests
Voice minutes count measured transcription input and generated speech duration. Realtime speech counts at 1× and quality speech at 2×; each request rounds up to the next whole voice second after weighting. Dialogue, vision and successful background memory extraction use their reported LLM tokens. Prices and included allowances are unchanged.
Requests producing no usable output consume no customer quota. If speech fails but text succeeds, only the model tokens count; failed speech does not use voice seconds or TTS characters. Peak covers unrecoverable provider fees. The portal distinguishes used allowance from processing holds. Available balance excludes holds, and unused reserved allowance is released after completion. An uncertain request may retain a hold until support reconciles it.
Refunded voice top-ups
A refunded top-up removes its full voice and TTS allowance. Recorded usage is preserved, the remaining balance cannot fall below zero, and the base license is not revoked by a top-up refund. A dispute temporarily holds the affected allowance; a confirmed win restores it once. A final refund or lost dispute cannot be reversed by a delayed payment notification. If subscription renewal already replaced that allowance, refunding the old top-up does not reduce the new period's base allowance. Tebex remains responsible for the payment and refund itself.
Subscription plan changes
Upgrades and downgrades take effect at the next paid renewal. Your current plan, server limit and recorded usage stay unchanged for the current billing period. At renewal, the new plan's allowance replaces the previous period's allowance. If a downgrade reduces your server limit, the oldest active server slots are retained and excess slots are revoked. Revoke unwanted slots before renewal to choose which servers remain. Tebex manages billing; the portal does not calculate mid-cycle charges or credits.
Privacy controls and hosted-memory deletion
Each server slot has separate controls for microphone transcription, generated voice, hosted personal memory, and disclosed screenshot vision. Portal limits take effect on the next managed authorization; local resource settings may be stricter. Vision is off by default.
Requesting hosted-memory deletion immediately disables managed memory for that server slot. It stays disabled while the request is pending. The private gateway drains queued memory work, deletes that server's hosted memories, relationships, and resident-to-character knowledge, clears any transient operator conversation summaries, and then records completion in the portal. Other server slots, NPC definitions, resident world profiles, commerce records, billing receipts, and audit events are preserved. This request does not erase FiveM-side resource KVP or framework records; coordinate those separately with the server owner when a broader deletion is required. Raw audio and screenshots are transient and are not stored as long-term memory.
The downloadable support bundle is generated in the browser from already-visible status data. It excludes installation secrets, provider keys, dialogue, audio, screenshots, and player identifiers.
FXServer Convars
For a managed-service installation, create a server slot in the customer portal and copy its reveal-once configuration. Provider keys remain on the Peak gateway:
cfgset peak_ai_npc_gateway_url "https://<gateway-domain>" set peak_ai_npc_server_id "srv_generated_by_portal" set peak_ai_npc_install_token "peak_service_reveal_once_value" ensure peak-ai-npc
Main Configuration (shared/config.lua)
Edit the existing values in shared/config.lua; this excerpt is not a replacement for the complete shipped configuration. The default stack is QBCore, qb-inventory, and qb-target. Start those dependencies before Peak AI NPC and enable OneSync on the server.
luaConfig.Framework = 'qbcore' Config.Inventory = 'qb-inventory' Config.Target = 'qb-target' Config.ServerLore = 'Los Santos is a bustling metropolis. Economy is realistic.' Config.Conversations.maxTurns = 100 Config.Conversations.idleTimeoutSeconds = 600 Config.Memory.retentionDays = 90 Config.Security.requireConfirmationForPurchases = true Config.Security.maximumTransactionValue = 5000
Qbox, ESX, Peak FW, other inventories and targets require explicit adapter setup and verification against the installed versions. An adapter being present does not establish connected gameplay support. Unsupported combinations fail closed. Keep police integrations disabled until duty, identity, data scope and installed-system checks pass.
Authoring Custom NPCs (npcs/examples.lua)
Edit the shipped definitions in npcs/examples.lua. Extra files in npcs/ are not automatically loaded by the protected manifest; adding them requires an operator-built release.
For example, the shipped Martin Hale shopkeeper uses the martin-hale voice profile and the 247supermarket catalog. Preserve the existing definition and edit its fields, rather than replacing the complete table:
luaAINPCDefinitions.shopkeeper.personality = 'Patient, observant, and concise. Never invents stock or prices.' AINPCDefinitions.shopkeeper.knowledge = 'Only knows the shop catalog, public server lore, and facts returned by tools.' AINPCDefinitions.shopkeeper.interactionDistance = 3.0
Shop items, stock and prices come from the server's configured catalog. Dialogue tools can request a purchase quote; the player must explicitly confirm before the server attempts a transaction. A model response cannot directly grant items or debit money. Confirm that imported catalog items exist in your installed inventory.
The current cast contains 27 owner-approved profiles, including 21 premade story-role voices. This approval covers the existing cast; custom profiles and recasts need their own audition and approval. Story-role profiles are reserved from ambient casting. Keep text and subtitles available while a profile is unapproved or unavailable. Language configuration does not by itself prove speech quality: each launch language still requires listening and in-game qualification.
Target Integration (client/targets.lua)
client/targets.lua registers configured roles by entity and adds a global Talk option for eligible ambient peds with ox_target or qb-target. The native fallback offers interaction without a target resource. Ambient eligibility and action scope are validated on the server.
Customize labels or registration options within the shipped implementation. Preserve its entity checks, duplicate-registration guards, resource-stop cleanup and target removal; replacing only the registration function can leave stale interactions after streaming or restart.
In-Game Commands & Permissions
| Command | Usage | Description |
|---|---|---|
/ainpc | Player | Talks to the aimed configured or ambient NPC; without an aimed ped, uses the nearest configured role. |
/ainpcvision [prompt] | Player | Captures an on-demand screenshot for vision analysis (requires screenshot-basic & vision provider). |
/ainpc_subtitles [mode] | Player | Updates 3D subtitle preference (always, never, audio_failed, accessibility). |
/ainpc_accessibility [on|off] | Player | Toggles high-contrast accessibility mode for subtitles. |
ainpc_status | Admin / Console | Displays diagnostic report (requires ACE permission ainpc.admin or console execution). |
Gateway Environment Setup (Peak operator only)
The companion gateway is operated by Peak and keeps all model, voice, and
transcription credentials off the customer server. Customers only configure the
managed endpoint and the reveal-once server credential shown in the portal.
Private deployments should use the operator intake and deployment runbook; do
not add provider keys to server.cfg, Lua files, or the NUI bundle.
Voice troubleshooting
Use the gateway endpoint assigned to your server slot and check ainpc_status in the server console. The operator must confirm that the gateway is healthy, speech is ready, and the requested profile is approved. Customers do not need to start a second gateway or enter a provider key.
If synthesis fails, keep text and subtitles enabled and include the redacted diagnostic report in your support request. Remote players require a reachable public HTTPS gateway; a loopback URL only works on the gateway's own computer.
Release qualification
The current release candidate has passed local code and startup checks. Connected gameplay acceptance remains pending, including microphone/audio playback, multiplayer spatial audio, targets, purchases, persistence and each advertised language. Use the exact candidate and the operator's live-test runbook before treating an integration or scenario as qualified.