Symfony\Component\Routing\Exception\InvalidParameterException: Parameter "model_id" for route "ai.edit_model_settings_form" must match "[^/]++"

Created on 5 September 2025, 26 days ago

Problem/Motivation

When using models from Ollama (or potentially other providers) that contain a slash or colon the provider form can become completely unavailable.

Steps to reproduce (required for bugs, but not feature requests)

Add a model like https://ollama.com/rjmalagon/gte-qwen2-1.5b-instruct-embed-f16 and visit the Ollama provider configuration page.

Proposed resolution

One possible solution is updating the route definition with

ai.edit_model_settings_form:
  path: '/admin/config/ai/providers/{operation_type}/{provider}/{model_id}'
  defaults:
    _form: '\Drupal\ai\Form\AiModelSettingsForm'
    _title_callback: '\Drupal\ai\Form\AiModelSettingsForm::createTitle'
  requirements:
    _permission: 'administer ai providers'
    model_id: ".+"

Though I am unaware of the implications of doing that. That brings the provider screen back up, but the edit form for that model is unavailable (leads to 404).

πŸ› Bug report
Status

Active

Version

1.2

Component

...to be triaged

Created by

πŸ‡ΊπŸ‡ΈUnited States kevinquillen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024