Issue 449 Knowledge Embeddings Any Provider - edmozley/freeitsm GitHub Wiki

Knowledge embeddings only used OpenAI, and failed silently (issue #449)

Reported in #449 by @Dr4inder. Fixed for 5.12.0.

What was wrong

  1. Embeddings were always OpenAI. Whatever the AI tab said, articles and questions were embedded with OpenAI text-embedding-3-small and the Embeddings key. An install that keeps AI on its own servers either sent every article to OpenAI or had no search by meaning.
  2. Generate said nothing useful. With no working key it ran through every article - 343 requests on the reporter's install - and ended "Completed with 343 errors out of 343 articles". The reasons were only in the browser console.
  3. Found while fixing it: the result box under Generate was never shown at all (an inline style outranked the success and error styles), and the shared AI settings would have carried an existing OpenAI key to a newly chosen custom server on an install that had never saved a provider.

What changed

  • Knowledge โ†’ Settings โ†’ Embeddings has its own provider - OpenAI, Azure OpenAI or your own OpenAI-compatible server (Ollama, LM Studio, vLLM) - with the server's model list and a Test. The AI tab now says that finding articles is set there.
  • Each vector records its model. Only vectors of the model set now are compared, so changing it re-embeds instead of comparing unlike vectors. Upgrades keep OpenAI and every existing vector.
  • Generate is disabled, with the reason, until it can work; a run stops at the first setup error and shows the reasons and counts on the page.
  • The gap analysis uses the same model and restarts its ticket cache when it changes.

How it fits together: Knowledge embeddings - developer guide.

What was checked

tests/knowledge-embeddings.php, 34 checks, against a stand-in OpenAI-compatible server - including that the OpenAI key is not sent to the new server (it was, before the fix), and that with the new column dropped nothing breaks and Database Verification restores and stamps it once. The tab itself was driven in Chrome: a broken model stops after one request with the server's reason; a working one embeds every article and says so.

Not proven here: a real Ollama model's vectors. The stand-in proves what FreeITSM sends and how it reads the answer; the reporter's server is where it is confirmed.


See also: Knowledge ยท Bugs resolved