AI Support Documentation
The script provides AI capabilities for users with the Partner role. For supported text fields, an AI button is available:
Supported API Providers
The system supports multiple AI providers:
- OpenAI API (GPT models)
- DeepSeek API
- Local LM Studio Server
Configuration
To enable AI features, modify the .env
file in your website's root directory.
OpenAI Configuration
# OpenAI configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="your-api-key"
OPENAI_MODEL="gpt-3.5-turbo"
OPENAI_BASE_URL="https://api.openai.com/v1"
DeepSeek Configuration
# DeepSeek configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="DeepSeek-API-key"
OPENAI_MODEL="deepseek-chat"
OPENAI_BASE_URL="https://api.deepseek.com"
OPENAI_API_URL="https://api.deepseek.com"
Local LM Studio Configuration
# LM Studio local server configuration
OPENAI_ENABLED=true
OPENAI_API_KEY="lm-studio"
OPENAI_BASE_URL="http://localhost:1234/v1"
OpenAI API Setup
To obtain an OpenAI API key:
- Create Account: Visit OpenAI and create an account or sign in
- Access API Section: Navigate to the API section in your account dashboard
- Generate Key: Create a new API key and name it for your reference
- Save Key: Copy and securely store your API key
- Configure: Add the key to your
.env
file as shown in the configuration section
Available OpenAI Models
OpenAI provides several models with different capabilities and pricing:
-
GPT Models
gpt-4o
: Latest flagship model with 128k context windowgpt-4
: Legacy GPT-4 model with 8k context windowgpt-3.5-turbo
: Legacy model (recommended to use gpt-4o-mini instead)- Best for: Various use cases from complex reasoning to everyday tasks
-
GPT-3.5 Series
gpt-3.5-turbo
: Balanced model for general use- Best for: Most general applications and day-to-day tasks
LM Studio Setup
LM Studio enables local AI model deployment for testing and development.
Installation Steps
- Download: Get LM Studio from lmstudio.ai
- Install: Run the installer for your operating system
- Launch: Start LM Studio after installation
Configuration Steps
- Select Model: Download your preferred language model (e.g.,
Meta-Llama-3-8B-Instruct-Q4_K_M.gguf
) - Start Server:
- Open LM Studio
- Navigate to 'Local Server' tab
- Click "Start Server"
- Configure Environment: Update your
.env
file with the LM Studio configuration shown above
DeepSeek Integration
DeepSeek provides an alternative API compatible with the OpenAI format.
Key Features
- Compatible with OpenAI-style prompts
- Alternative pricing structure
- Different model specializations
Setup Steps
- Register: Create an account at DeepSeek's platform
- Generate API Key: Obtain your DeepSeek API key
- Configure: Add the DeepSeek configuration to your
.env
file as shown above
Troubleshooting
Common issues and solutions:
-
API Connection Errors
- Verify API key is correctly copied
- Check network connectivity
- Ensure BASE_URL is correctly formatted
-
Model Loading Issues
- Confirm model name matches exactly
- Verify API provider supports the selected model
- Check for sufficient system resources
-
LM Studio Connection
- Verify local server is running
- Check port 1234 is available
- Ensure no firewall blocking