Raze NPCAI
View resource ↗Raze-NPCAI — Installation Guide
Raze-NPCAI is a free and open-source FiveM resource that allows players to have real voice conversations with NPCs.
NPCs can respond to questions, remember conversations, follow commands, and interact with players during traffic stops and other roleplay scenarios.
This version uses Google Gemini and Groq. There are no license keys, website activations, or subscriptions required by RazeScripts.
Important: Support is only provided for official, unmodified releases of Raze-NPCAI. If you modify the source code, you will no longer be eligible for support. Changes made through the provided configuration files are permitted.
01 — Requirements
- FiveM Server
- OneSync Enabled
- Server Artifacts Supporting Node.js 22
- Google Gemini API Key
- Groq API Key
- Internet Access
Optional Requirements
- Night's ERS — for enhanced law enforcement interactions.
- Microsoft .NET SDK — required when compiling from source.
Raze-NPCAI is completely standalone and does not require:
- QBCore
- Qbox
- ESX
- ElevenLabs
- Raze_Core
- MySQL or a database
- RazeScripts License Key
02 — Installation
- Download Raze-NPCAI from RazeScripts.com.
- Extract the downloaded ZIP file.
- Locate the folder named
Raze_NPCAI. - Move the folder into your server's resources directory.
Your resource folder should look similar to this:
resources/
└── [raze]/
└── Raze_NPCAI/
├── client/
├── config/
├── dist/
├── server/
├── web/
└── fxmanifest.lua
Make sure the following compiled files are present:
dist/Raze_NPCAI.Client.net.dll
dist/Raze_NPCAI.Server.net.dll
If you downloaded the prebuilt resource, you do not need to compile anything.
If you downloaded the source code, follow the compiling instructions provided in Section 12 of this guide.
03 — Setting Up Google Gemini
Google Gemini Live is the primary AI provider used for real-time NPC voice conversations.
Creating an API Key
- Visit Google AI Studio.
- Sign in with your Google account.
- Select
Create API Key. - Select or create a Google project if prompted.
- Copy your generated API key.
Keep this key somewhere private. You will need it when configuring the resource.
Make sure your Google project has access to the Gemini Live model configured in the resource.
Never share your API key with other players or publicly post it in Discord.
04 — Setting Up Groq
Groq is used as a fallback when Gemini Live is unavailable.
Groq handles microphone transcription, NPC responses, and voice generation through its configured AI models.
Creating an API Key
- Visit Groq Console.
- Create an account or sign in.
- Select
Create API Key. - Name the key
Raze-NPCAI. - Copy your generated API key.
Accepting Orpheus Model Terms
Visit the following page:
If prompted, accept the model terms using the administrator account associated with your Groq organization.
If the model requires accepted terms and you have not accepted them, NPCs may be unable to generate voice responses through Groq.
Once the terms have been accepted, restart the resource.
05 — Configuring Your API Keys
The recommended way to configure your API keys is through your server.cfg.
Add the following lines:
set raze_npcai_gemini_api_key "YOUR_GEMINI_API_KEY"
set raze_npcai_groq_api_key "YOUR_GROQ_API_KEY"
Replace the placeholders with your actual API keys.
Always use
set. Do not usesetrorsets, as these may expose information outside the server.
Alternative Configuration
You can also configure your API keys directly inside:
Raze_NPCAI/config/server_config.json
Locate the existing Gemini and Groq API key settings and enter your keys.
You do not need to configure your API keys in both places.
Keys configured through server.cfg take priority over keys configured in the JSON file.
Never include your API keys when sharing configuration files with other people.
06 — Starting the Resource
Standalone Installation
Add the following to your server.cfg below your API keys:
ensure Raze_NPCAI
Night's ERS Installation
If your server uses Night's ERS, make sure ERS starts before Raze-NPCAI.
Example:
ensure night_ers
ensure Raze_NPCAI
Make sure the ERS resource name matches the name used by your installation and integration settings.
If ERS is already started elsewhere in your configuration, you do not need to add another ensure line.
Once everything has been configured, restart your server and check the server console for any errors.
07 — Controls
Use the configured NPC push-to-talk key to begin speaking to an NPC. Release the key when you have finished speaking.
Players can view and change their registered keybinds through:
ESC → Settings → Key Bindings → FiveM
The default keybind can also be adjusted through the provided client configuration.
If the keybind conflicts with another resource, change it to an available key.
08 — Using Raze-NPCAI
Walk up to an NPC, look toward them, and hold your configured push-to-talk key.
Speak normally into your microphone and release the key when you are finished.
The NPC will process what you said and respond based on the conversation and surrounding circumstances.
Example Conversations
- What is your name?
- Where are you headed?
- What are you doing out here?
- Have you seen anything suspicious?
- Do you need any help?
- Can you tell me what happened?
- Where are you coming from?
NPCs can remember previous conversations and respond based on their current situation.
Nearby players can also hear NPC responses through spatial audio when shared audio is enabled.
09 — Law Enforcement Interactions
Raze-NPCAI supports natural voice commands, allowing officers to interact with NPCs without relying entirely on interaction menus.
Supported Interaction Examples
- Ask an NPC to identify themselves.
- Ask a driver to roll down their window.
- Request that a driver exits their vehicle.
- Tell a suspect to stop walking.
- Tell a suspect to stop approaching you.
- Tell a suspect to surrender.
- Tell a suspect to drop their weapon.
- Tell a suspect to get on their knees.
- Give supported handcuffing commands.
- Give supported search commands.
- Release a detained suspect.
NPCs may not always cooperate with your commands.
Their behavior can depend on their current state, surrounding circumstances, and the active ERS scenario.
Night's ERS Integration
When Night's ERS is installed, Raze-NPCAI can provide enhanced interactions during supported traffic stops and callouts.
Night's ERS is not required for regular NPC conversations.
10 — Configuration
Raze-NPCAI includes separate client and server configuration files.
Client Configuration
Raze_NPCAI/config/client_config.json
The client configuration allows you to adjust supported settings such as:
- Default push-to-talk key
- NPC conversation distance
- Physical interaction distance
- Spatial audio
- On-screen notifications
- Player interaction settings
Server Configuration
Raze_NPCAI/config/server_config.json
The server configuration includes settings for:
- Gemini API integration
- Groq API integration
- AI model selection
- NPC conversation memory
- Conversation memory duration
- Spatial audio distance
- NPC voice volume
- Audio relay settings
- Diagnostic logging
It is recommended to test the default settings before making any major configuration changes.
Changes made through the provided configuration files are permitted and will not affect your eligibility for support.
Always make a backup of your configuration before making changes.
Invalid JSON formatting may prevent the resource from working correctly.
11 — AI Providers
Raze-NPCAI uses multiple AI services to handle NPC conversations and voice responses.
| Provider | Purpose |
|---|---|
Gemini Live |
Primary real-time NPC conversations. |
Groq Whisper |
Microphone audio transcription. |
Groq GPT-OSS |
NPC response generation. |
Groq Orpheus |
NPC voice generation. |
Gemini TTS |
Fallback voice generation. |
If Gemini Live becomes unavailable, the resource will attempt to use the configured Groq fallback.
If Groq voice generation fails, the resource can attempt to generate the response using Gemini TTS.
AI model availability, pricing, and usage limits are controlled by their respective providers and may change at any time.
12 — Compiling From Source
Raze-NPCAI is open source, meaning developers can modify the resource and compile their own versions.
This section is only required if you downloaded the uncompiled source code or made changes to the C# files.
Warning: If you modify the original source code, RazeScripts will not provide support for your modified version. You are responsible for maintaining and troubleshooting any changes you make.
Build Requirements
- Windows PC
- Microsoft .NET SDK
- Internet Access
Download the .NET SDK here:
Make sure you install the SDK, not just the runtime.
Building the Resource
- Extract the source code ZIP.
- Open the
Raze_NPCAIproject folder. - Run
BUILD.bat. - Allow the required NuGet packages to download.
- Wait for the compilation to complete.
- Check the build window for any errors.
- Verify the compiled DLL files are present.
dist/Raze_NPCAI.Client.net.dll
dist/Raze_NPCAI.Server.net.dll
Do not install an incomplete build on your server.
If either DLL is missing, review the errors displayed during compilation.
Editing the Resource
Changes made to C# files require recompiling the resource.
Lua, JavaScript, HTML, CSS, and JSON files can generally be edited without recompiling the C# project.
However, modifications to any original source code will make your version ineligible for support.
Normal changes to the provided configuration files are excluded from this policy.
13 — Troubleshooting
Missing DLL Files
If your server console displays:
Warning: could not find client_script
dist/Raze_NPCAI.Client.net.dll
Warning: could not find server_script
dist/Raze_NPCAI.Server.net.dll
Make sure you downloaded the prebuilt resource rather than the uncompiled source code.
If you are using the source code, run BUILD.bat and verify both DLL files were generated successfully.
Do not remove or rename any dependencies included with the resource.
NPCs Cannot Hear Me
- Check your default Windows microphone.
- Check your Windows microphone permissions.
- Verify your FiveM keybind.
- Make sure your microphone is not muted.
- Make sure you are within conversation range.
- Check your F8 console for errors.
NPCs Are Not Responding
- Verify your API keys are correct.
- Check your server console for provider errors.
- Verify your selected AI models are available.
- Check your provider usage limits.
- Make sure your server has internet access.
- Restart Raze-NPCAI.
Groq HTTP 400 Error
Check the actual error displayed in your server console.
If the error mentions Orpheus model terms, visit the Groq Playground and accept the required terms using the appropriate organization administrator account.
Restart the resource afterward.
HTTP 401 or 403 Errors
These errors may indicate an invalid API key, missing permissions, or restricted model access.
Verify your API keys and provider account settings.
HTTP 429 Error
This usually means you have reached a provider's rate limit or usage limit.
Check your Gemini or Groq account dashboard for additional information.
NPCs Respond Without Audio
- Check your server console for TTS errors.
- Verify that Orpheus model terms were accepted.
- Check your Gemini TTS configuration.
- Verify your client audio settings.
- Check whether your provider has reached a usage limit.
Delayed NPC Responses
Response times can depend on several factors:
- AI provider response times
- Internet connection
- Provider usage limits
- Selected AI models
- Length of the conversation
- Server performance
RazeScripts cannot guarantee a specific response time from third-party AI providers.
ERS Interactions Are Not Working
- Make sure Night's ERS is installed.
- Verify that ERS starts before Raze-NPCAI.
- Check your integration configuration.
- Check your server console for errors.
- Make sure you are using a compatible ERS version.
14 — Diagnostics
When troubleshooting an issue, check both your FiveM F8 console and your server console.
Additional diagnostic logging may be enabled through the provided resource configuration or diagnostic commands, depending on your release version.
When reporting an issue, reproduce the problem with diagnostics enabled if available and provide the relevant logs.
Always remove private API keys and sensitive information from logs and screenshots before sharing them.
15 — Updating the Resource
When a new version of Raze-NPCAI becomes available:
- Stop Raze-NPCAI.
- Back up your existing configuration files.
- Download the latest available version.
- Replace the existing resource files.
- Transfer your custom configuration settings.
- Restart the resource.
restart Raze_NPCAI
Always check the update notes before transferring older configuration files into a newer version.
Do not automatically overwrite new configuration files with older versions, as newer releases may include additional settings.
If you have modified the source code, you are responsible for transferring your modifications into newer releases.
16 — Important Information
Raze-NPCAI is completely free to download and use.
However, Gemini and Groq are third-party AI services with their own usage limits, pricing, and availability.
RazeScripts does not provide API keys or guarantee unlimited free AI usage.
Third-Party Services
RazeScripts is not responsible for:
- AI provider outages
- API usage limits
- API charges
- Changes to third-party AI models
- Discontinued AI services
- Restrictions placed on your provider accounts
- Response delays caused by third-party services
Player Privacy
Player microphone audio and conversation information used to generate NPC responses are sent to the configured AI providers.
Server owners are responsible for informing their players about this functionality and complying with applicable privacy requirements.
Never share your private API keys with other players or include them in publicly distributed files.
17 — Open Source
Raze-NPCAI was originally developed and maintained by RazeScripts.
The resource has been made free and open source to allow the FiveM community to learn from it, improve it, and customize it for their own servers.
All use, modification, and redistribution of the source code is subject to the license included with the resource.
Source Code Modifications
By modifying the source code, you accept full responsibility for maintaining your modified version.
RazeScripts will not provide support for any version of Raze-NPCAI that contains modified source code.
This includes, but is not limited to:
- Changes to the original C# source code.
- Changes to the original Lua or JavaScript files.
- Modified HTML or CSS files.
- Custom integrations.
- Additional or modified features.
- Modified AI provider implementations.
- Changes to the original resource functionality.
- Errors caused by third-party modifications.
- Performance issues caused by custom changes.
- Compilation errors caused by modified source code.
Configuration Changes
Changes made through the officially provided configuration files are permitted and will not affect your eligibility for support.
This includes changing API keys, keybinds, AI models through supported configuration settings, conversation settings, and other available configuration options.
Restoring Support Eligibility
If you experience an issue after modifying the source code, you must:
- Download a fresh, official release of Raze-NPCAI.
- Remove your modified version.
- Install the original, unmodified resource.
- Reproduce the issue using the official release.
If the issue cannot be reproduced on an official, unmodified release, support will not be provided.
RazeScripts will not troubleshoot, repair, or maintain custom versions of this resource.
18 — Support
Support is only provided for official, unmodified releases of Raze-NPCAI.
If you experience an issue, please open a support ticket in the official RazeScripts Discord.
When opening a support ticket, please include:
- Resource version
- Server artifact version
- Description of the issue
- Relevant server console errors
- Relevant F8 console errors
- Screenshots or recordings, if applicable
Support Will Not Be Provided For
- Modified source code
- Custom versions of Raze-NPCAI
- Unsupported third-party integrations
- Issues caused by custom code
- Third-party AI provider outages
- API account restrictions
- API usage charges
- Requests to develop custom features
As Raze-NPCAI is a free and open-source resource, support is provided at our discretion and is not guaranteed.
Thank you to everyone who has supported Raze-NPCAI throughout its development.
RazeScripts
Copyright © 2026 RazeScripts.
Distributed under the license included with the resource.