Commit graph

28 commits

Author SHA1 Message Date
copilot-swe-agent[bot]
6a1e44c8ff Fix markdown parsing to handle multi-line constructs correctly
Co-authored-by: mudler <[email protected]>
2026-02-03 11:42:51 +00:00
Ettore Di Giacinto
397f7f0862
fix(ui): take account of reasoning in token count calculation (#8324)
We were skipping reasoning traces when counting tokens, yielding to a
wrong sum count.

Signed-off-by: Ettore Di Giacinto <[email protected]>
2026-02-01 10:48:31 +01:00
Ettore Di Giacinto
c88074a19e
feat(api): support 'reasoning' api field (#7959)
This PR adds support to support the 'reasoning' API field of the OpenAI
spec.

LocalAI now will extract automatically thinking tags in both SSE and
non-SSE mode. The changes are adapted as well to the Chat UI now that
will use the reasoning field to extract the thinking process and display
it in the chat.

This fixes https://github.com/mudler/LocalAI/issues/7944

Signed-off-by: Ettore Di Giacinto <[email protected]>
2026-01-10 19:06:12 +01:00
Ettore Di Giacinto
33cc0b8e13
fix(chat/ui): record model name in history for consistency (#7845)
Signed-off-by: Ettore Di Giacinto <[email protected]>
2026-01-03 18:05:33 +01:00
Ettore Di Giacinto
8ac7e8c299
fix(chat-ui): model selection toggle and new chat (#7574)
Fixes a minor glitch that happens when switching model in from the chat
pane where the header was not getting updated. Besides, it allows to
create new chat directly when clicking from the management pane to the
model.

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-12-14 22:29:11 +01:00
Ettore Di Giacinto
53e5b2d6be
feat: agent jobs panel (#7390)
* feat(agent): agent jobs

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Multiple webhooks, simplify

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Do not use cron with seconds

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Create separate pages for details

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Detect if no models have MCP configuration, show wizard

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Make services test to run

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-28 23:05:39 +01:00
Ettore Di Giacinto
71ed03102f
feat(ui): add chat history (#7325)
* feat(chat): add history and management

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Display in progress chats

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Fetch available context size as we switch chat

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Add search

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Display MCP toggle correctly

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Re-ordering

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Re-style

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Stable ordering

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Display token/sec correctly

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Visual changes

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Display chat time

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-24 11:48:24 +01:00
Ettore Di Giacinto
2dd42292dc
feat(ui): runtime settings (#7320)
* feat(ui): add watchdog settings

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Do not re-read env

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Some refactor, move other settings to runtime (p2p)

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Add API Keys handling

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Allow to disable runtime settings

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Documentation

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Small fixups

Signed-off-by: Ettore Di Giacinto <[email protected]>

* show MCP toggle in index

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Drop context default

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-20 22:37:20 +01:00
Ettore Di Giacinto
77bbeed57e
feat(importer): unify importing code with CLI (#7299)
* feat(importer): support ollama and OCI, unify code

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat: support importing from local file

Signed-off-by: Ettore Di Giacinto <[email protected]>

* support also yaml config files

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Correctly handle local files

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Extract importing errors

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Add importer tests

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Add integration tests

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore(UX): improve and specify supported URI formats

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fail if backend does not have a runfile

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Adapt tests

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(gallery): add cache for galleries

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix(ui): remove handler duplicate

File input handlers are now handled by Alpine.js @change handlers in chat.html.
Removed duplicate listeners to prevent files from being processed twice

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix(ui): be consistent in attachments in the chat

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Fail if no importer matches

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix: propagate ops correctly

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Fixups

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-19 20:52:11 +01:00
Ettore Di Giacinto
93cd688f40
chore: small ux enhancements (#7290)
* chore: improve chat attachments

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: display installed backends/models

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-17 17:09:42 +01:00
Ettore Di Giacinto
721c3f962b
chore: scroll in thinking mode, better buttons placement (#7289)
Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-17 16:21:14 +01:00
Ettore Di Giacinto
cd7d384500
feat: restyle index (#7282)
* Move management to separate section

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Make index to redirect to chat

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Use logo in index

Signed-off-by: Ettore Di Giacinto <[email protected]>

* work out the wizard in the front-page

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-16 11:01:05 +01:00
Ettore Di Giacinto
47b546afdc
feat(mcp): add LocalAI endpoint to stream live results of the agent (#7274)
* feat(mcp): add LocalAI endpoint to stream live results of the agent

Signed-off-by: Ettore Di Giacinto <[email protected]>

* wip

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Refactoring

Signed-off-by: Ettore Di Giacinto <[email protected]>

* MCP UX integration

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Enhance UX

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Support also non-SSE

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-15 17:38:00 +01:00
Ettore Di Giacinto
8876073f5c
feat(ui): chat stats, small visual enhancements (#7223)
* feat(ui): show stats in chat, improve style

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Markdown, small improvements

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Display token/sec into stats

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Minor enhancement

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Small fixups

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Fixups

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Revert "Fixups"

This reverts commit ab1b3d6da9.

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-10 18:12:07 +01:00
Ettore Di Giacinto
679d43c2f5
feat: respect context and add request cancellation (#7187)
* feat: respect context

Signed-off-by: Ettore Di Giacinto <[email protected]>

* workaround fasthttp

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(ui): allow to abort call

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Refactor

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore: improving error

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Respect context also with MCP

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Tie to both contexts

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Make detection more robust

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-11-09 18:19:19 +01:00
Ettore Di Giacinto
2e51871ad5
feat(ui): add button to enable Agentic MCP (#6400)
Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-10-07 00:05:34 +02:00
Ettore Di Giacinto
bef4c10629
feat(ui): General improvements (#6072)
* wip

* Simplify stop

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Improve UI

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Show installed backends at the index

Signed-off-by: Ettore Di Giacinto <[email protected]>

* Imporve UI

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-08-16 07:44:50 +02:00
Ettore Di Giacinto
8472321a81
feat(ui): display thinking tags appropriately (#5540)
* fix(streaming): stream complete runes

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(ui): display thinking tags separately

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-05-31 08:50:46 +02:00
Ettore Di Giacinto
59db154cbc
feat(ui): allow to upload PDF and text files, also add support to multiple input files (#5538)
* Support file inputs

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat: support multiple files

Signed-off-by: Ettore Di Giacinto <[email protected]>

* show preview of files

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-05-31 08:47:48 +02:00
Ettore Di Giacinto
45c58752e5
feat(ui): add audio upload button in chat view (#5526)
Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-05-30 16:47:31 +02:00
Ettore Di Giacinto
de81b42b49
feat(ui): remove api key handling and small ui adjustments (#4948)
* chore(ui): drop set api key button

Signed-off-by: Ettore Di Giacinto <[email protected]>

* chore(ui): shore in-progress installs in model view

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(ui): improve text to image view

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-03-05 19:37:36 +01:00
Ettore Di Giacinto
755e4fb5f4
feat(ui): improvements to index and models page (#4918)
- mobile-friendly index
- adjust color palette
- improve search experience

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-02-28 19:23:32 +01:00
Ettore Di Giacinto
c87870b18e
feat(ui): improve chat interface (#4910)
* feat(ui): show more informations in the chat view, minor adjustments to model gallery

Signed-off-by: Ettore Di Giacinto <[email protected]>

* fix(ui): UI improvements

Visual improvements and bugfixes including:
- disable pagination during search
- fix scrolling on new message

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2025-02-26 18:27:18 +01:00
Max Goltzsche
8cc2d01caa
feat(ui): path prefix support via HTTP header (#4497)
Makes the web app honour the `X-Forwarded-Prefix` HTTP request header that may be sent by a reverse-proxy in order to inform the app that its public routes contain a path prefix.
For instance this allows to serve the webapp via a reverse-proxy/ingress controller under a path prefix/sub path such as e.g. `/localai/` while still being able to use the regular LocalAI routes/paths without prefix when directly connecting to the LocalAI server.

Changes:
* Add new `StripPathPrefix` middleware to strip the path prefix (provided with the `X-Forwarded-Prefix` HTTP request header) from the request path prior to matching the HTTP route.
* Add a `BaseURL` utility function to build the base URL, honouring the `X-Forwarded-Prefix` HTTP request header.
* Generate the derived base URL into the HTML (`head.html` template) as `<base/>` tag.
* Make all webapp-internal URLs (within HTML+JS) relative in order to make the browser resolve them against the `<base/>` URL specified within each HTML page's header.
* Make font URLs within the CSS files relative to the CSS file.
* Generate redirect location URLs using the new `BaseURL` function.
* Use the new `BaseURL` function to generate absolute URLs within gallery JSON responses.

Closes #3095

TL;DR:
The header-based approach allows to move the path prefix configuration concern completely to the reverse-proxy/ingress as opposed to having to align the path prefix configuration between LocalAI, the reverse-proxy and potentially other internal LocalAI clients.
The gofiber swagger handler already supports path prefixes this way, see e2d9e9916d/swagger.go (L79)

Signed-off-by: Max Goltzsche <[email protected]>
2025-01-07 17:18:21 +01:00
Sertaç Özercan
0d62594099
fix: fix chat webui response parsing (#2515)
fix: fix chat webui

Signed-off-by: Sertac Ozercan <[email protected]>
2024-06-07 17:20:31 +02:00
Ettore Di Giacinto
6559ac11b1
feat(ui): prompt for chat, support vision, enhancements (#2259)
* feat(ui): allow to set system prompt for chat

Make also the models in the index clickable, and display as table

Fixes #2257

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(vision): support also png with base64 input

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(ui): support vision and upload of files

Signed-off-by: Ettore Di Giacinto <[email protected]>

* display the processed image

Signed-off-by: Ettore Di Giacinto <[email protected]>

* make trust remote code stand out

Signed-off-by: mudler <[email protected]>

* feat(ui): track in progress job across index/model gallery

Signed-off-by: mudler <[email protected]>

* minor fixups

Signed-off-by: mudler <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
Signed-off-by: mudler <[email protected]>
2024-05-08 00:42:34 +02:00
Ettore Di Giacinto
b58274b8a2
feat(ui): support multilineand style ul (#2226)
* feat(ui/chat): handle multiline in the input field

Signed-off-by: mudler <[email protected]>

* feat(ui/chat): correctly display multiline messages

Signed-off-by: mudler <[email protected]>

* feat(ui/chat): add list style

Signed-off-by: mudler <[email protected]>

---------

Signed-off-by: mudler <[email protected]>
2024-05-03 00:43:02 +02:00
Ettore Di Giacinto
2c5a46bc34
feat(ux): Add chat, tts, and image-gen pages to the WebUI (#2222)
* feat(webui): Add chat page

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(webui): Add image-gen page

Signed-off-by: Ettore Di Giacinto <[email protected]>

* feat(webui): Add tts page

Signed-off-by: Ettore Di Giacinto <[email protected]>

---------

Signed-off-by: Ettore Di Giacinto <[email protected]>
2024-05-02 21:14:10 +02:00