Commit ac4329d
feat: support custom OpenAI-compatible API endpoints (#2135)
* feat: support custom OpenAI-compatible API endpoints (Ollama, LM Studio, etc.)
Add configurable base URL and custom model name to allow using any
OpenAI-compatible API provider. Models are now fetched dynamically
from the configured API endpoint instead of a hardcoded list.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add error handling for unreachable API providers and model fetch failures
Show user-friendly error messages when the API endpoint is unreachable,
API key is invalid, or model is not found. Add retry button for failed
model loading. Includes translations for all 11 languages.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: add Test API connection button, changelog and documentation
- Add sendTo handler 'testApiConnection' in main.ts for server-side
API connectivity testing
- Add test button in admin jsonConfig using sendTo
- Add WORK IN PROGRESS changelog entry in README.md
- Add documentation for custom API support in docs/en and docs/de
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: remove Custom model name field, models are fetched dynamically
The custom model name config field is unnecessary since available models
are now fetched dynamically from the API endpoint and shown in the
dropdown. Removed from config, i18n, dialog logic and documentation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: remove invalid icon from test API connection button
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* build: recompile backend to include testApiConnection handler
The sendTo handler was only in src/main.ts but the compiled build/main.js
was missing it, causing the test button to spin indefinitely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: move all API calls server-side via sendTo to avoid CORS issues
- Add 'chatCompletion' sendTo handler for proxying chat requests
- Model loading already uses 'testApiConnection' sendTo handler
- Remove OpenAI SDK usage from browser (no more dangerouslyAllowBrowser)
- All API communication now goes through the adapter backend,
which avoids CORS issues with local providers like Ollama
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: build frontend, fix TypeScript error type and disabled prop
- Fix error state type from boolean to string | false
- Fix disabled prop to use !!error for boolean coercion
- Rebuild frontend assets with server-side API changes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: restore admin/tab.html and admin/custom/ removed by build
The frontend build process incorrectly deleted tab.html and the custom
components directory, breaking the script editor tab. Restore original
build artifacts - source changes remain in src-editor for future builds.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: rebuild frontend correctly with manual copy and tab.html generation
The automated build task failed on Node 25 due to deprecated rmdirSync.
Built editor with vite directly and manually copied assets + generated
tab.html with socket.io and monaco script injection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add Content-Length header and increase timeout to 600s for chat requests
Local LLMs (Ollama) need Content-Length to process the request body
correctly and more time to generate responses with large prompts.
Also explicitly set stream: false for compatibility.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: strip LLM thinking artifacts from code generator responses
Local models (Ollama) often output <think> blocks, <|endoftext|> tokens,
and reasoning commentary alongside code. The response parser now:
- Strips <think>...</think> blocks
- Strips special tokens (<|endoftext|>, <|im_start|>, <|im_end|>)
- Intelligently extracts code from unstructured responses
- Removes trailing LLM commentary after code
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add recommended providers (Gemini free, DeepSeek) and note about ChatGPT
- Add Google Gemini as recommended free provider with setup instructions
- Add DeepSeek as affordable alternative
- Add guidance for local models (14B+ recommended)
- Note that free OpenAI/ChatGPT API no longer works for code generation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: strip 'models/' prefix from Google Gemini model IDs
Google's API returns model IDs like 'models/gemini-2.0-flash' but the
chat completions endpoint expects just 'gemini-2.0-flash'.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: cleanup orphaned build assets and update changelog
- Remove old OpenAiDialog/ScriptEditor assets no longer referenced
- Update WORK IN PROGRESS changelog (remove 'custom model name',
add server-side proxy and artifact stripping)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: allow empty API key for local providers like Ollama
Local providers (Ollama, LM Studio) don't require authentication.
The API key check now only rejects requests when no key AND no custom
base URL is set. The Authorization header is omitted entirely when
no key is configured.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* style: fix prettier formatting for sendTo calls
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Removed useless models
* Removed useless models
* Fixed some minor possible errors
* Fix linter
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: GermanBluefox <dogafox@gmail.com>1 parent 2dd6051 commit ac4329d
234 files changed
Lines changed: 6341 additions & 159075 deletions
File tree
- admin
- assets
- custom
- assets
- i18n
- google-blockly
- media
- msg
- js
- own
- msg
- i18n
- plugins
- vs
- base
- browser/ui/codicons/codicon
- worker
- basic-languages
- html
- javascript
- typescript
- editor
- language
- css
- html
- json
- typescript
- build
- lib
- docs
- de
- en
- src-admin
- src-editor
- src
- Components
- OpenAi
- i18n
- src
- lib
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
28 | 36 | | |
29 | 37 | | |
30 | 38 | | |
| |||
40 | 48 | | |
41 | 49 | | |
42 | 50 | | |
43 | | - | |
| 51 | + | |
44 | 52 | | |
45 | 53 | | |
46 | 54 | | |
| |||
0 commit comments