feat: Replace /manage HTML scraping with REST API (v1.3.0) - #13
Merged
Conversation
The /manage page was removed in LocalAI v4.x. This commit updates the integration to use the stable REST API instead: - Remove ModelTableParser HTML scraping class and /manage page fetching - Model running/idle status now determined via /system endpoint's loaded_models field - Version sensor reads from /version endpoint - All endpoints (/v1/models, /backends, /system, /resources, /version, /models/jobs) are stable REST APIs available in LocalAI v4.2.0+ - Bump integration version to 1.3.0 - Update README to document LocalAI v4.2.0+ requirement Tested against LocalAI v4.2.4 with 23 models, 26 backends, running model detection via loaded_models working correctly. Fixes the recurring error: 'No models found in /manage page - HTML structure may have changed'
Contributor
There was a problem hiding this comment.
Pull request overview
Replaces the now-removed /manage HTML scraping with the stable /system REST endpoint to determine running model status, restoring functionality against LocalAI v4.x and bumping the integration to v1.3.0.
Changes:
- Removes
ModelTableParserand the_fetch_model_detailsHTML parsing path from the coordinator. - Updates the Models sensor to derive
Running/Idlestatus fromloaded_modelsin the/systemresponse. - Bumps
manifest.jsonto1.3.0and updates README to document the LocalAI v4.2.0+ requirement and migration.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| custom_components/localai_monitor/coordinator.py | Removes the ModelTableParser class and /manage HTML fetch/parse logic. |
| custom_components/localai_monitor/sensor.py | Replaces HTML-derived model details with running status pulled from /system loaded_models. |
| custom_components/localai_monitor/manifest.json | Bumps integration version to 1.3.0. |
| README.md | Documents new LocalAI v4.2.0+ requirement, removes references to scraped attributes, and adds a Compatibility section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
loryanstrant
pushed a commit
that referenced
this pull request
Jun 9, 2026
…onical main (for v1.4.0)' (#2) from feat/incorporate-pr13-rest-api into main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
/managepage was removed in LocalAI v4.x, causing the following error to repeat every poll cycle:This was tracked upstream in LocalAI issue #9207 and addressed in LocalAI PR #9411.
Solution
Replace the HTML scraping approach with the stable REST API:
/manageHTML page for model names, status, backend, use cases/systemendpoint'sloaded_modelsfield for running statusModelTableParser(HTMLParser subclass)Changes
ModelTableParserHTML parser class (~65 lines of fragile HTML parsing code)/managepage fetch from the coordinator update looploaded_modelsfrom/systemendpoint instead of the HTML table's status columnRunning/Idlestatus using the sameloaded_modelsdata/versionendpoint — no change needed1.2.0→1.3.0inmanifest.json/managepageTesting
Validated against LocalAI v4.2.4:
All 7 entities loaded successfully in a dev Home Assistant instance with no errors.
Breaking Change
This integration version (v1.3.0+) requires LocalAI v4.2.0 or newer. If running an older LocalAI version, use integration v1.2.0 or earlier.