Skip to content

Fixes #5669 - Enable chatCompletions experimental feature via CLI and ENV #5701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

martin-g
Copy link
Contributor

@martin-g martin-g commented Jun 23, 2025

Pull Request

Related issue

Fixes #5669

What does this PR do?

Currently the new chatCompletions feature could be enabled only via

curl \
  -X PATCH 'MEILISEARCH_URL/experimental-features/' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "chatCompletions": true
  }'

https://www.meilisearch.com/docs/reference/api/chats#chat-completions-workspace-object

Now it will be possible to use

  1. command line argument: --experimental_chat_completions
  2. or environment variable: export MEILI_EXPERIMENTAL_CHAT_COMPLETIONS=true
  3. via the config file setting experimental_chat_completions (meilisearch --config-file-path ...)

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

…e via CLI and ENV

https://www.meilisearch.com/docs/reference/api/chats#chat-completions-workspace-object
Currently the new `chatCompletions` feature could be enabled only via
```
curl \
  -X PATCH 'MEILISEARCH_URL/experimental-features/' \
  -H 'Content-Type: application/json' \
  --data-binary '{
    "chatCompletions": true
  }'
```

Now it will be possible to use
1) command line argument: `--experimental_chat_completions`
2) or environment variable:
   `export MEILI_EXPERIMENTAL_CHAT_COMPLETIONS=true`

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
martin-g added 2 commits June 23, 2025 11:31
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g
Copy link
Contributor Author

There is an issue in the current implementation (this PR):

  1. Enabling the feature via the REST API stores a setting in the DB (runtime features). (this is old logic)
  2. With the new code I also use the value read from the config file / env var / cli argument (the config).
  3. So, if the feature is enabled via REST API, a restart of Meilisearch will overwrite the stored value with the one from the config, i.e. false ...

I do not see any support for Setting::NotSet for the values coming from the config. I'll dig deeper but any hints are welcome!

Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
@martin-g
Copy link
Contributor Author

Adding the new setting to InstanceTogglableFeatures seems to fix the problem!

@martin-g martin-g marked this pull request as ready for review June 25, 2025 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update config.toml file to reflect chatCompletion experimental feature
1 participant