feat(ai): Bring Your Own Key (BYOK) & local/custom model support - #8986
Open
BillyOutlast wants to merge 5 commits into
Open
feat(ai): Bring Your Own Key (BYOK) & local/custom model support#8986BillyOutlast wants to merge 5 commits into
BillyOutlast wants to merge 5 commits into
Conversation
…oint support - Add CustomAIClient with full OpenAI chat completions, reasoning/thinking extraction, tool calling, and local request caching - Add complete tool schemas and robust argument extractors for all 29 GDevelop editor functions - Add AI Settings tab in Preferences to configure custom endpoint URL, API Key, Model ID, temperature, and streaming - Bypass cloud subscription/credit entitlement gates and S3 presigned URL uploads when custom endpoint is active - Support batch instance placement in put_2d_instances / put_3d_instances and flexible parameter aliases
- package.json: remove unused react-dnd-html5-backend and react-refresh, pin babel-plugin-macros to ^2.8.0 - CustomAIClient: exclude apiKey from localStorage persistence, normalize base URL without auto-appending /v1, bound local requests cache to 20 items, add cancel token support with axios, restrict markdown tool parsing to side-effect-free tools, return empty results for asset/resource searches - UseGenerateEvents: use activeUserId in getAiGeneratedEvent polling - EditorFunctions: validate batch entries before scene insertion in put2dInstances and put3dInstances, fix instance rotation with setAngle for 3D - Preferences: fix temperature input to support 0 and clamp 0.0-1.0, exclude apiKey from localStorage - Generation & Usage: route requests and events by local ID prefix, partition status requests, decouple BYOK checks from subscription status - Tests: reset state in beforeEach, update tests for base URL normalization, side-effect-free tools, and empty search results
…in Generation API
feat(ai): Bring Your Own Key (BYOK) custom OpenAI-compatible endpoint support
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
Addresses #7932 and #8854.
This PR adds an opt-in Bring Your Own Key (BYOK) & Custom / Local AI Endpoint feature to GDevelop, allowing game creators to connect any OpenAI-compatible API endpoint (such as local servers like Ollama, llama.cpp, LM Studio, or remote providers like OpenAI, OpenRouter, Azure OpenAI, Groq, DeepSeek, etc.) to the GDevelop AI Assistant and Standalone Creation Form.
Key Highlights & Features
OpenAI-Compatible Client (
CustomAIClient.js):/chat/completions) with tool calling support.<think>tags andreasoning_content).AbortSignal/CancelToken.Comprehensive Tool Calling Support:
Preferences & Configuration UI:
localStorage), Model Name, and Temperature (0.0–1.0)./modelsor a lightweight completion to verify connectivity and lists available models.100% Opt-in & Non-Breaking:
local-ai-*,local-evt-*), leaving cloud-hosted request handling completely intact.Issues Addressed
Testing & Verification
CustomAIClient.spec.jscovering configuration, URL normalization, message transformation, tool parsing, thinking extraction, and request lifecycle.qwen2.5-coder,llama3.2) and OpenAI endpoints.npm test -- --watchAll=false).