- AI
- A
Connecting DeepSeek Chat to Alice
In this article, you will learn how to integrate GPT into Alice's speaker without foreign servers, using DeepSeek. We will show step-by-step setup of PHP hosting, explain where to get the necessary keys, and how to configure the skill in Yandex.Dialogs. The result is a smart assistant capable of answering questions using the power of GPT.
Background
In the previous article, we configured a skill for Alice using OpenAI GPT, which required foreign hosting and created many difficulties. Now there is a simpler way: use the DeepSeek API — a solution for which you can use any suitable hosting.
Links to materials
Requirements
Hosting with PHP 7.4 support and above.
Composer for dependency management.
cURL extension for PHP (included by default on many hostings).
DeepSeek API key (obtained when registering for the DeepSeek service).
Tip: Pay attention to the presence of HTTPS (SSL certificate). Yandex.Dialogues do not accept requests over an unsecured connection. If your hosting does not have a certificate, use the free Let’s Encrypt.
Step 1. Create a website on hosting
Prepare the environment:
Make sure your hosting supports the required PHP version and Composer is installed.
Make sure the domain name is linked and available via HTTPS.
Add the site to the hosting control panel:
Create a new domain or subdomain.
Set up an SSL certificate (e.g., Let’s Encrypt).
(If necessary) configure DNS:
If the domain was recently purchased, wait for the DNS records to update.
Step 2. Connect via SSH and clone the repository
Connect to the server via SSH:
ssh username@your-domain.com
Go to your site folder and clone the repository:
git clone https://github.com/zabarov/alice-deepseek.git .
Make sure the repository files (e.g.,
index.php
,composer.json
, etc.) appear in the root of the site.
Step 3. Install dependencies
Go to the project root and run:
composer install
This will pull in all the necessary libraries and packages. If the command does not work, check that Composer is installed and available in PATH.
Step 4. Configuring the .env file
Create a
.env
file based on the example file:
cp .env.example .env
Open the
.env
file with any editor (e.g.,nano .env
) and insert your DeepSeek API key:
DEEPSEEK_API_KEY=your_deepseek_api_key
Save the changes.
Important: The
.env
file should not be included in the public repository to prevent the API key from being accessible to third parties.
Step 5. Configuring the skill in Yandex.Dialogs
Create a new skill in Yandex.Dialogs.
Main settings:
Skill name: come up with a short, easily recognizable name.
Backend: specify the address of your website (e.g.,
https://your-domain.com/index.php
).Voice: you can choose any voice to make the skill different from Alice's "voice".
Publish the skill. Yandex will check the configuration and, if set up correctly, will allow you to test it.
Testing the skill
In the Yandex.Dialogs interface:
Click "Test" and enter any phrase to make sure the skill works.
Check the response logs to ensure correct operation.
In the Alice column or app:
Invoke the skill with a voice command, for example: "Alice, launch [your skill name]" or "Alice, ask [skill name]".
Make sure the response comes from GPT via DeepSeek.
Common errors and their solutions
No secure connection (HTTPS)
Read also:Without HTTPS, Yandex.Dialogs reject requests. Check that the certificate is installed correctly.
Backend is incorrectly specified
Make sure that the
index.php
address is specified correctly and accessible from the outside (404/403 error indicates lack of access).
DNS issues
If the domain is new, wait for the DNS to update (usually from 1 to 24 hours).
API key not found
Check that the
DEEPSEEK_API_KEY
is correctly specified in the.env
.Make sure that the
.env
file is not ignored by Git or missed when uploading to the server.
Write comment