Repository navigation
feat(api): add OpenAI Decisions endpoint - #12603
Merged
Merged
Conversation
Share SystemOne execution and preserve ordered, typed Decisions answers. Reject null probabilities and derive scores from the emitted distribution. Cover conversion and handler contracts using a valid generated PNG fixture. Assisted-by: nib:gpt-6-astra Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Keep canonical JSON values in model-visible choice criteria and represent probability label presence explicitly. Add conversion and serialization regressions. Assisted-by: nib:gpt-6-astra Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Expose the adapter through the shared Decisions feature gate and usage middleware. Test real route registration with a fake backend, including unauthenticated access, user permissions, and exact usage accounting. Assisted-by: nib:gpt-6-astra Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Describe the shared local execution contract, typed questions, image limits, and backend accounting. Publish the Decisions route in Swagger and retain the existing SystemOne discovery tag. Use documented loose object placeholders for JSON unions that Swagger 2 cannot express. Assisted-by: nib:gpt-6-astra Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
mudler
approved these changes
Oct 9, 2026
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.
Description
Add
POST /v1/decisionsas an OpenAI-compatible REST adapter over LocalAI's existing SystemOne execution. No new inference backend or internal HTTP round trip./v1/systemone; preserve its existing API.systemoneinstruction group; document examples and compatibility limits.Notes for Reviewers
This is a local execution adapter, not access to OpenAI's hosted model. Confidence retains local SystemOne semantics. Images reuse existing inline-image validation and backend limits; message text and images are flattened into the existing request format. Unsupported image detail settings are rejected.
safety_identifieris accepted as compatibility metadata, not an identity or hosted safety service.Usage reflects backend-reported counts. Detailed token-accounting objects can be empty when the backend does not provide those fields. Swagger 2 uses documented loose placeholders for JSON unions; runtime choice values remain strings or booleans.
Verification run independently after implementation:
All passed. Tests use a fake backend and exercise HTTP routing, permissions, accounting, conversion, and SystemOne regressions. Protobuf sources were generated and an ignored minimal UI embed fixture supplied for Go route tests. No full native build, GPU inference, or real-model validation was performed.
Swagger was regenerated with
github.com/swaggo/swag/cmd/swag@v1.16.6; route/schema references were validated. Changes add only this route and its related definitions.Signed commits
docs/content/).AI assistance is recorded in the commit trailers.