AI writing assistant.
Configure AI-powered text assistance for Partners using OpenAI, DeepSeek, or local models.
The AI Writing Assistant helps Partners create and improve text content in the dashboard. When enabled, an AI button appears in supported text fields, offering quick transformations like improving grammar, adjusting tone, or generating content.
What it does
| Feature | Description |
|---|---|
| Text Improvement | Refine grammar, spelling, and clarity |
| Tone Adjustments | Make text more formal, casual, or friendly |
| Content Generation | Generate descriptions, summaries, and copy |
| Quick Transformations | One-click formatting and style changes |
Supported providers
The system uses an OpenAI-compatible API format, supporting multiple providers:
| Provider | Description | Cost |
|---|---|---|
| OpenAI | GPT models from OpenAI | Pay-per-use API |
| DeepSeek | Alternative AI with competitive pricing | Pay-per-use API |
| LM Studio | Run open-source models locally | Free (local hardware) |
All providers use the same configuration variables, so you can switch between them.
Configuration
The assistant reads four environment variables:
| Variable | Purpose | Default |
|---|---|---|
OPENAI_ENABLED |
Turns the AI features on or off | false |
OPENAI_API_KEY |
Your provider's API key | empty |
OPENAI_MODEL |
The model name sent with every request | gpt-4 |
OPENAI_BASE_URL |
The API endpoint; point it at any OpenAI-compatible service | https://api.openai.com/v1 |
OPENAI_ORGANIZATION is an optional fifth variable for OpenAI accounts that belong to an organization.
Enable AI features by adding the following to your .env file:
OpenAI
OPENAI_ENABLED=true
OPENAI_API_KEY="your-api-key"
OPENAI_MODEL="gpt-3.5-turbo"
OPENAI_BASE_URL="https://api.openai.com/v1"
DeepSeek
OPENAI_ENABLED=true
OPENAI_API_KEY="your-deepseek-key"
OPENAI_MODEL="deepseek-chat"
OPENAI_BASE_URL="https://api.deepseek.com"
LM Studio (local)
OPENAI_ENABLED=true
OPENAI_API_KEY="lm-studio"
OPENAI_BASE_URL="http://localhost:1234/v1"
After updating your .env file, clear the config cache:
php artisan config:clear
How requests are sent
The assistant calls the chat completions endpoint on the configured base URL. Every request includes a max_tokens limit (a small per-field value) and a preset temperature, so the configured model must accept those parameters. Models that reject them, such as reasoning models with restricted parameter support, fail with an API error.
OpenAI setup
To use OpenAI's GPT models:
- Visit platform.openai.com and create an account
- Navigate to API Keys in your dashboard
- Click Create new secret key and name it for reference
- Copy the key now. You won't see it again
- Add the key to your
.envfile asOPENAI_API_KEY
Choosing a model
When OPENAI_MODEL is not set, the app uses gpt-4. The sample .env ships with gpt-3.5-turbo. Any model that accepts standard chat completions requests with max_tokens and temperature works, whether from OpenAI or from another OpenAI-compatible service configured via OPENAI_BASE_URL.
For the latest models and pricing, see OpenAI's model documentation.
DeepSeek setup
DeepSeek provides an OpenAI-compatible API with competitive pricing:
- Create an account at platform.deepseek.com
- Navigate to your API dashboard
- Generate an API key
- Add the DeepSeek configuration to your
.envfile
DeepSeek models
| Model | Description |
|---|---|
deepseek-chat |
General-purpose conversational model |
deepseek-reasoner |
Reasoning model for harder writing tasks |
The app recognizes deepseek-chat and deepseek-reasoner by name and adjusts the request format for them. Other DeepSeek model names are sent as regular chat completions requests.
LM Studio setup
LM Studio lets you run open-source AI models locally, ideal for development, testing, or privacy-focused deployments.
Installation
- Download LM Studio from lmstudio.ai
- Install and launch the application
- Search for and download a model (e.g., Llama 3.2, Mistral, or Qwen)
Starting the local server
- Open LM Studio
- Go to the Local Server tab
- Select your downloaded model
- Click Start Server
- The API will be available at
http://localhost:1234/v1
Recommended local models
For text writing assistance, consider:
- Llama 3.2 8B: Good balance of speed and quality
- Mistral 7B: Fast and efficient
- Qwen 2.5 7B: Strong multilingual support
Model quality depends on your hardware. Start with smaller models (7B–8B parameters) if you have limited RAM.
Troubleshooting
Connection errors
| Issue | Solution |
|---|---|
| "API key invalid" | Verify you copied the key with no extra spaces |
| "Connection refused" | Check network connectivity or firewall settings |
| "Model not found" | Confirm the model name matches your provider's documentation |
| "Unsupported parameter" | The model rejects max_tokens or temperature. Configure a model that accepts standard chat completions parameters |
LM Studio issues
| Issue | Solution |
|---|---|
| Connection refused | Ensure the local server is running |
| Port already in use | Check if another service uses port 1234 |
| Slow responses | Try a smaller model or check system resources |
| Server crashes | Reduce context length or use a quantized model |
General tips
- Clear cache after any
.envchanges:php artisan config:clear - Check logs in
storage/logs/laravel.logfor error details - Test the API with a curl command before troubleshooting the app
Related topics
- Languages & translations: Multi-language support
- Email configuration: Another
.envconfiguration - Partners overview: Partner dashboard features