This technical README should help you set up a local development environment for the Aristote Plume project. This project is an integration of the Storm method in a web application, allowing authenticated users to generate wikipedia-like synthesis on any science subject, with sources quotation.
- Git
- Docker and docker compose
Run the following command to build and start the project :
ln -s ../../webapp/bin/pre-commit.sh .git/hooks/pre-commit # pre-commit script (to run php-cs-fixer)
cp -f ./webapp/.env ./webapp/.env.local
cp -f ./webapp/.php-cs-fixer.dist.php ./webapp/.php-cs-fixer.php
cp -f ./backend/.env.dist ./backend/.env
echo "127.0.0.1 aristote-plume-local.centralesupelec.fr" | sudo tee -a /etc/hosts
docker compose build
docker compose run --rm -it --entrypoint "" php php composer install
docker compose run --rm -it --entrypoint "" assets npm install
docker compose up -d
Make sure to adjust the webapp/.env.local
file to your needs. Some values are just placeholders for secrets, or will
depend on your configuration. Take a look at the web application configuration section
of the readme.
You also need to adjust the backend/.env
to configure the backend workers, in charge of generating the articles. Take
a look at the associated section of the readme.
Users authentication is delegated to an external provider with OpenID Connect protocol. The following environment variables must be configured:
OIDC_WELL_KNOWN_URL="Your OIDC server well known URL"
OIDC_CLIENT_ID="The client ID"
OIDC_CLIENT_SECRET="The client secret"
OIDC_SCOPES="OIDC scopes as comma separated values (e.g. 'openid' or 'openid,profile,email')"
OIDC_USER_IDENTIFIER_PROPERTY="Must be the user email"
OIDC_USER_IDENTIFIER_FROM_ID_TOKEN="Whether email should be obtained from the userinfo endpoint (0) or id token (1)"
If you do not have an OIDC provider to configure, or if it is not possible to set it up for your development environment, you can set up a keycloak OIDC server locally and use it as an OIDC provider.
In the local development environment, minio is used to provide object
storage with s3 apis compatibility. To configure minio
:
- Go to the minio admin dashboard, and log in as administrator (root credentials in
environment variables of the
minio
service in compose.yml) - Create a bucket for the application (
plume-local
) - Create an access key, and report its identifier / secret in the corresponding environment variables
(
S3_STORAGE_ACCESS_KEY
/S3_STORAGE_SECRET_KEY
)
The following environment variables can now be configured:
S3_STORAGE_ENDPOINT_URL=http://minio:9000
S3_STORAGE_UPLOAD_DIRECTORY=generated-articles
S3_STORAGE_REGION=eu-west-2
S3_STORAGE_BUCKET_NAME=plume-local
S3_STORAGE_ACCESS_KEY=change_me
S3_STORAGE_SECRET_KEY=change_me
This configuration should not be used as-is in a production environment (minio should be configured more finely).
Article generation is handled by a python celery worker, exposed with a fast api application.
The application relies on large language models to generate articles content. This can be configured with the three
following variables (the environment file path is backend/.env
):
# Aristote dispatcher configuration (LLM endpoint)
ARISTOTE_DISPATCHER_URI=https://open-ai-compatible-api-uri.com
ARISTOTE_DISPATCHER_PORT=443
ARISTOTE_DISPATCHER_API_KEY=change_me
Aristote Dispatcher is CentraleSupélec's gateway project to expose LLM inference servers, but any api following openai schema should work fine.
The same environment variables as the ones passed to the webapp have to be set for the python backend. Please refer to
the web application configuration section for details (the environment file path is
backend/.env
).
Redis is used as a key-value store for php sessions of the web application, and also as a backend for Celery
. It must
be accessible for both the fastapi application and the celery worker.
Default settings should work fine, but if you want to change it you should edit both the backend environment file and the docker compose file.