LlamaFinetuneGGUF commited on
Commit
17b565d
·
unverified ·
2 Parent(s): f20173f f3cdb7a

Merge pull request #1 from oTToDev-CE/stable-changes

Browse files
.env.example CHANGED
@@ -38,12 +38,18 @@ OLLAMA_API_BASE_URL=
38
  # You only need this environment variable set if you want to use OpenAI Like models
39
  OPENAI_LIKE_API_BASE_URL=
40
 
 
 
 
41
  # You only need this environment variable set if you want to use DeepSeek models through their API
42
  DEEPSEEK_API_KEY=
43
 
44
  # Get your OpenAI Like API Key
45
  OPENAI_LIKE_API_KEY=
46
 
 
 
 
47
  # Get your Mistral API Key by following these instructions -
48
  # https://console.mistral.ai/api-keys/
49
  # You only need this environment variable set if you want to use Mistral models
 
38
  # You only need this environment variable set if you want to use OpenAI Like models
39
  OPENAI_LIKE_API_BASE_URL=
40
 
41
+ # You only need this environment variable set if you want to use Together AI models
42
+ TOGETHER_API_BASE_URL=
43
+
44
  # You only need this environment variable set if you want to use DeepSeek models through their API
45
  DEEPSEEK_API_KEY=
46
 
47
  # Get your OpenAI Like API Key
48
  OPENAI_LIKE_API_KEY=
49
 
50
+ # Get your Together API Key
51
+ TOGATHER_API_KEY=
52
+
53
  # Get your Mistral API Key by following these instructions -
54
  # https://console.mistral.ai/api-keys/
55
  # You only need this environment variable set if you want to use Mistral models
Dockerfile CHANGED
@@ -25,6 +25,8 @@ ARG ANTHROPIC_API_KEY
25
  ARG OPEN_ROUTER_API_KEY
26
  ARG GOOGLE_GENERATIVE_AI_API_KEY
27
  ARG OLLAMA_API_BASE_URL
 
 
28
  ARG VITE_LOG_LEVEL=debug
29
  ARG DEFAULT_NUM_CTX
30
 
@@ -36,6 +38,8 @@ ENV WRANGLER_SEND_METRICS=false \
36
  OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY} \
37
  GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY} \
38
  OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL} \
 
 
39
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
40
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
41
 
@@ -58,6 +62,8 @@ ARG ANTHROPIC_API_KEY
58
  ARG OPEN_ROUTER_API_KEY
59
  ARG GOOGLE_GENERATIVE_AI_API_KEY
60
  ARG OLLAMA_API_BASE_URL
 
 
61
  ARG VITE_LOG_LEVEL=debug
62
  ARG DEFAULT_NUM_CTX
63
 
@@ -68,6 +74,8 @@ ENV GROQ_API_KEY=${GROQ_API_KEY} \
68
  OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY} \
69
  GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY} \
70
  OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL} \
 
 
71
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
72
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
73
 
 
25
  ARG OPEN_ROUTER_API_KEY
26
  ARG GOOGLE_GENERATIVE_AI_API_KEY
27
  ARG OLLAMA_API_BASE_URL
28
+ ARG TOGETHER_API_KEY
29
+ ARG TOGETHER_API_BASE_URL
30
  ARG VITE_LOG_LEVEL=debug
31
  ARG DEFAULT_NUM_CTX
32
 
 
38
  OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY} \
39
  GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY} \
40
  OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL} \
41
+ TOGETHER_API_KEY=${TOGETHER_API_KEY} \
42
+ TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \
43
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
44
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
45
 
 
62
  ARG OPEN_ROUTER_API_KEY
63
  ARG GOOGLE_GENERATIVE_AI_API_KEY
64
  ARG OLLAMA_API_BASE_URL
65
+ ARG TOGETHER_API_KEY
66
+ ARG TOGETHER_API_BASE_URL
67
  ARG VITE_LOG_LEVEL=debug
68
  ARG DEFAULT_NUM_CTX
69
 
 
74
  OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY} \
75
  GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY} \
76
  OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL} \
77
+ TOGETHER_API_KEY=${TOGETHER_API_KEY} \
78
+ TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL} \
79
  VITE_LOG_LEVEL=${VITE_LOG_LEVEL} \
80
  DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX}
81
 
FAQ.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [![Bolt.new: AI-Powered Full-Stack Web Development in the Browser](./public/social_preview_index.jpg)](https://bolt.new)
2
+
3
+ # Bolt.new Fork by Cole Medin - oTToDev
4
+
5
+ ## FAQ
6
+
7
+ ### How do I get the best results with oTToDev?
8
+
9
+ - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
10
+
11
+ - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
12
+
13
+ - **Scaffold the basics first, then add features**: Make sure the basic structure of your application is in place before diving into more advanced functionality. This helps oTToDev understand the foundation of your project and ensure everything is wired up right before building out more advanced functionality.
14
+
15
+ - **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask oTToDev to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
16
+
17
+ ### Do you plan on merging oTToDev back into the official Bolt.new repo?
18
+
19
+ More news coming on this coming early next month - stay tuned!
20
+
21
+ ### Why are there so many open issues/pull requests?
22
+
23
+ oTToDev was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly
24
+ grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can.
25
+ That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all
26
+ the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off!
27
+
28
+ ### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for oTToDev/Bolt.new?
29
+
30
+ As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs!
31
+
32
+ ### I'm getting the error: "There was an error processing this request"
33
+
34
+ If you see this error within oTToDev, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right.
35
+
36
+ ### I'm getting the error: "x-api-key header missing"
37
+
38
+ We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run oTToDev with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while!
39
+
40
+ ### I'm getting a blank preview when oTToDev runs my app!
41
+
42
+ We promise you that we are constantly testing new PRs coming into oTToDev and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well.
43
+
44
+ ### How to add a LLM:
45
+
46
+ To make new LLMs available to use in this version of Bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
47
+
48
+ By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
49
+
50
+ When you add a new model to the MODEL_LIST array, it will immediately be available to use when you run the app locally or reload it. For Ollama models, make sure you have the model installed already before trying to use it here!
51
+
52
+ ### Everything works but the results are bad
53
+
54
+ This goes to the point above about how local LLMs are getting very powerful but you still are going to see better (sometimes much better) results with the largest LLMs like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. If you are using smaller LLMs like Qwen-2.5-Coder, consider it more experimental and educational at this point. It can build smaller applications really well, which is super impressive for a local LLM, but for larger scale applications you want to use the larger LLMs still!
README.md CHANGED
@@ -8,7 +8,7 @@ This fork of Bolt.new (oTToDev) allows you to choose the LLM that you use for ea
8
 
9
  https://thinktank.ottomator.ai
10
 
11
- ## Requested Additions to this Fork - Feel Free to Contribute!!
12
 
13
  - ✅ OpenRouter Integration (@coleam00)
14
  - ✅ Gemini Integration (@jonathands)
@@ -32,13 +32,13 @@ https://thinktank.ottomator.ai
32
  - ✅ Cohere Integration (@hasanraiyan)
33
  - ✅ Dynamic model max token length (@hasanraiyan)
34
  - ✅ Prompt caching (@SujalXplores)
35
- - ✅ **HIGH PRIORITY** - Load local projects into the app (@wonderwhy-er)
 
 
36
  - ⬜ **HIGH PRIORITY** - ALMOST DONE - Attach images to prompts (@atrokhym)
37
  - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
38
  - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
39
  - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call
40
- - ⬜ Mobile friendly
41
- - ⬜ Together Integration
42
  - ⬜ Azure Open AI API Integration
43
  - ⬜ Perplexity Integration
44
  - ⬜ Vertex AI Integration
@@ -198,15 +198,6 @@ sudo npm install -g pnpm
198
  ```bash
199
  pnpm run dev
200
  ```
201
-
202
- ## Adding New LLMs:
203
-
204
- To make new LLMs available to use in this version of Bolt.new, head on over to `app/utils/constants.ts` and find the constant MODEL_LIST. Each element in this array is an object that has the model ID for the name (get this from the provider's API documentation), a label for the frontend model dropdown, and the provider.
205
-
206
- By default, Anthropic, OpenAI, Groq, and Ollama are implemented as providers, but the YouTube video for this repo covers how to extend this to work with more providers if you wish!
207
-
208
- When you add a new model to the MODEL_LIST array, it will immediately be available to use when you run the app locally or reload it. For Ollama models, make sure you have the model installed already before trying to use it here!
209
-
210
  ## Available Scripts
211
 
212
  - `pnpm run dev`: Starts the development server.
@@ -228,55 +219,16 @@ pnpm run dev
228
 
229
  This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
230
 
231
- ## FAQ
232
-
233
- ### How do I get the best results with oTToDev?
234
-
235
- - **Be specific about your stack**: If you want to use specific frameworks or libraries (like Astro, Tailwind, ShadCN, or any other popular JavaScript framework), mention them in your initial prompt to ensure Bolt scaffolds the project accordingly.
236
-
237
- - **Use the enhance prompt icon**: Before sending your prompt, try clicking the 'enhance' icon to have the AI model help you refine your prompt, then edit the results before submitting.
238
-
239
- - **Scaffold the basics first, then add features**: Make sure the basic structure of your application is in place before diving into more advanced functionality. This helps oTToDev understand the foundation of your project and ensure everything is wired up right before building out more advanced functionality.
240
-
241
- - **Batch simple instructions**: Save time by combining simple instructions into one message. For example, you can ask oTToDev to change the color scheme, add mobile responsiveness, and restart the dev server, all in one go saving you time and reducing API credit consumption significantly.
242
-
243
- ### How do I contribute to oTToDev?
244
 
245
  [Please check out our dedicated page for contributing to oTToDev here!](CONTRIBUTING.md)
246
 
247
- ### Do you plan on merging oTToDev back into the official Bolt.new repo?
248
-
249
- More news coming on this coming early next month - stay tuned!
250
-
251
- ### What are the future plans for oTToDev?
252
 
253
  [Check out our Roadmap here!](https://roadmap.sh/r/ottodev-roadmap-2ovzo)
254
 
255
  Lot more updates to this roadmap coming soon!
256
 
257
- ### Why are there so many open issues/pull requests?
258
-
259
- oTToDev was started simply to showcase how to edit an open source project and to do something cool with local LLMs on my (@ColeMedin) YouTube channel! However, it quickly
260
- grew into a massive community project that I am working hard to keep up with the demand of by forming a team of maintainers and getting as many people involved as I can.
261
- That effort is going well and all of our maintainers are ABSOLUTE rockstars, but it still takes time to organize everything so we can efficiently get through all
262
- the issues and PRs. But rest assured, we are working hard and even working on some partnerships behind the scenes to really help this project take off!
263
-
264
- ### How do local LLMs fair compared to larger models like Claude 3.5 Sonnet for oTToDev/Bolt.new?
265
-
266
- As much as the gap is quickly closing between open source and massive close source models, you’re still going to get the best results with the very large models like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. This is one of the big tasks we have at hand - figuring out how to prompt better, use agents, and improve the platform as a whole to make it work better for even the smaller local LLMs!
267
-
268
- ### I'm getting the error: "There was an error processing this request"
269
-
270
- If you see this error within oTToDev, that is just the application telling you there is a problem at a high level, and this could mean a number of different things. To find the actual error, please check BOTH the terminal where you started the application (with Docker or pnpm) and the developer console in the browser. For most browsers, you can access the developer console by pressing F12 or right clicking anywhere in the browser and selecting “Inspect”. Then go to the “console” tab in the top right.
271
-
272
- ### I'm getting the error: "x-api-key header missing"
273
-
274
- We have seen this error a couple times and for some reason just restarting the Docker container has fixed it. This seems to be Ollama specific. Another thing to try is try to run oTToDev with Docker or pnpm, whichever you didn’t run first. We are still on the hunt for why this happens once and a while!
275
-
276
- ### I'm getting a blank preview when oTToDev runs my app!
277
-
278
- We promise you that we are constantly testing new PRs coming into oTToDev and the preview is core functionality, so the application is not broken! When you get a blank preview or don’t get a preview, this is generally because the LLM hallucinated bad code or incorrect commands. We are working on making this more transparent so it is obvious. Sometimes the error will appear in developer console too so check that as well.
279
-
280
- ### Everything works but the results are bad
281
 
282
- This goes to the point above about how local LLMs are getting very powerful but you still are going to see better (sometimes much better) results with the largest LLMs like GPT-4o, Claude 3.5 Sonnet, and DeepSeek Coder V2 236b. If you are using smaller LLMs like Qwen-2.5-Coder, consider it more experimental and educational at this point. It can build smaller applications really well, which is super impressive for a local LLM, but for larger scale applications you want to use the larger LLMs still!
 
8
 
9
  https://thinktank.ottomator.ai
10
 
11
+ ## Requested Additions - Feel Free to Contribute!
12
 
13
  - ✅ OpenRouter Integration (@coleam00)
14
  - ✅ Gemini Integration (@jonathands)
 
32
  - ✅ Cohere Integration (@hasanraiyan)
33
  - ✅ Dynamic model max token length (@hasanraiyan)
34
  - ✅ Prompt caching (@SujalXplores)
35
+ - ✅ Load local projects into the app (@wonderwhy-er)
36
+ - ✅ Together Integration (@mouimet-infinisoft)
37
+ - ✅ Mobile friendly (@qwikode)
38
  - ⬜ **HIGH PRIORITY** - ALMOST DONE - Attach images to prompts (@atrokhym)
39
  - ⬜ **HIGH PRIORITY** - Prevent Bolt from rewriting files as often (file locking and diffs)
40
  - ⬜ **HIGH PRIORITY** - Better prompting for smaller LLMs (code window sometimes doesn't start)
41
  - ⬜ **HIGH PRIORITY** - Run agents in the backend as opposed to a single model call
 
 
42
  - ⬜ Azure Open AI API Integration
43
  - ⬜ Perplexity Integration
44
  - ⬜ Vertex AI Integration
 
198
  ```bash
199
  pnpm run dev
200
  ```
 
 
 
 
 
 
 
 
 
201
  ## Available Scripts
202
 
203
  - `pnpm run dev`: Starts the development server.
 
219
 
220
  This will start the Remix Vite development server. You will need Google Chrome Canary to run this locally if you use Chrome! It's an easy install and a good browser for web development anyway.
221
 
222
+ ## How do I contribute to oTToDev?
 
 
 
 
 
 
 
 
 
 
 
 
223
 
224
  [Please check out our dedicated page for contributing to oTToDev here!](CONTRIBUTING.md)
225
 
226
+ ## What are the future plans for oTToDev?
 
 
 
 
227
 
228
  [Check out our Roadmap here!](https://roadmap.sh/r/ottodev-roadmap-2ovzo)
229
 
230
  Lot more updates to this roadmap coming soon!
231
 
232
+ ## FAQ
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
233
 
234
+ [Please check out our dedicated page for FAQ's related to oTToDev here!](FAQ.md)
app/components/chat/ExamplePrompts.tsx CHANGED
@@ -10,8 +10,16 @@ const EXAMPLE_PROMPTS = [
10
 
11
  export function ExamplePrompts(sendMessage?: { (event: React.UIEvent, messageInput?: string): void | undefined }) {
12
  return (
13
- <div id="examples" className="relative w-full max-w-xl mx-auto mt-8 flex justify-center">
14
- <div className="flex flex-col space-y-2 [mask-image:linear-gradient(to_bottom,black_0%,transparent_180%)] hover:[mask-image:none]">
 
 
 
 
 
 
 
 
15
  {EXAMPLE_PROMPTS.map((examplePrompt, index: number) => {
16
  return (
17
  <button
@@ -19,10 +27,9 @@ export function ExamplePrompts(sendMessage?: { (event: React.UIEvent, messageInp
19
  onClick={(event) => {
20
  sendMessage?.(event, examplePrompt.text);
21
  }}
22
- className="group flex items-center w-full gap-2 justify-center bg-transparent text-bolt-elements-textTertiary hover:text-bolt-elements-textPrimary transition-theme"
23
  >
24
  {examplePrompt.text}
25
- <div className="i-ph:arrow-bend-down-left" />
26
  </button>
27
  );
28
  })}
 
10
 
11
  export function ExamplePrompts(sendMessage?: { (event: React.UIEvent, messageInput?: string): void | undefined }) {
12
  return (
13
+ <div
14
+ id="examples"
15
+ className="relative flex flex-col gap-9 w-full max-w-3xl mx-auto flex justify-center mt-6"
16
+ >
17
+ <div
18
+ className="flex flex-wrap justify-center gap-2"
19
+ style={{
20
+ animation: '.25s ease-out 0s 1 _fade-and-move-in_g2ptj_1 forwards',
21
+ }}
22
+ >
23
  {EXAMPLE_PROMPTS.map((examplePrompt, index: number) => {
24
  return (
25
  <button
 
27
  onClick={(event) => {
28
  sendMessage?.(event, examplePrompt.text);
29
  }}
30
+ className="border border-bolt-elements-borderColor rounded-full bg-gray-50 hover:bg-gray-100 dark:bg-gray-950 dark:hover:bg-gray-900 text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary px-3 py-1 text-xs transition-theme"
31
  >
32
  {examplePrompt.text}
 
33
  </button>
34
  );
35
  })}
app/components/workbench/EditorPanel.tsx CHANGED
@@ -1,6 +1,6 @@
1
  import { useStore } from '@nanostores/react';
2
- import { memo, useEffect, useMemo, useRef, useState } from 'react';
3
- import { Panel, PanelGroup, PanelResizeHandle, type ImperativePanelHandle } from 'react-resizable-panels';
4
  import {
5
  CodeMirrorEditor,
6
  type EditorDocument,
@@ -9,21 +9,17 @@ import {
9
  type OnSaveCallback as OnEditorSave,
10
  type OnScrollCallback as OnEditorScroll,
11
  } from '~/components/editor/codemirror/CodeMirrorEditor';
12
- import { IconButton } from '~/components/ui/IconButton';
13
  import { PanelHeader } from '~/components/ui/PanelHeader';
14
  import { PanelHeaderButton } from '~/components/ui/PanelHeaderButton';
15
- import { shortcutEventEmitter } from '~/lib/hooks';
16
  import type { FileMap } from '~/lib/stores/files';
17
  import { themeStore } from '~/lib/stores/theme';
18
- import { workbenchStore } from '~/lib/stores/workbench';
19
- import { classNames } from '~/utils/classNames';
20
  import { WORK_DIR } from '~/utils/constants';
21
- import { logger, renderLogger } from '~/utils/logger';
22
  import { isMobile } from '~/utils/mobile';
23
  import { FileBreadcrumb } from './FileBreadcrumb';
24
  import { FileTree } from './FileTree';
25
- import { Terminal, type TerminalRef } from './terminal/Terminal';
26
- import React from 'react';
27
 
28
  interface EditorPanelProps {
29
  files?: FileMap;
@@ -38,8 +34,6 @@ interface EditorPanelProps {
38
  onFileReset?: () => void;
39
  }
40
 
41
- const MAX_TERMINALS = 3;
42
- const DEFAULT_TERMINAL_SIZE = 25;
43
  const DEFAULT_EDITOR_SIZE = 100 - DEFAULT_TERMINAL_SIZE;
44
 
45
  const editorSettings: EditorSettings = { tabSize: 2 };
@@ -62,13 +56,6 @@ export const EditorPanel = memo(
62
  const theme = useStore(themeStore);
63
  const showTerminal = useStore(workbenchStore.showTerminal);
64
 
65
- const terminalRefs = useRef<Array<TerminalRef | null>>([]);
66
- const terminalPanelRef = useRef<ImperativePanelHandle>(null);
67
- const terminalToggledByShortcut = useRef(false);
68
-
69
- const [activeTerminal, setActiveTerminal] = useState(0);
70
- const [terminalCount, setTerminalCount] = useState(1);
71
-
72
  const activeFileSegments = useMemo(() => {
73
  if (!editorDocument) {
74
  return undefined;
@@ -81,48 +68,6 @@ export const EditorPanel = memo(
81
  return editorDocument !== undefined && unsavedFiles?.has(editorDocument.filePath);
82
  }, [editorDocument, unsavedFiles]);
83
 
84
- useEffect(() => {
85
- const unsubscribeFromEventEmitter = shortcutEventEmitter.on('toggleTerminal', () => {
86
- terminalToggledByShortcut.current = true;
87
- });
88
-
89
- const unsubscribeFromThemeStore = themeStore.subscribe(() => {
90
- for (const ref of Object.values(terminalRefs.current)) {
91
- ref?.reloadStyles();
92
- }
93
- });
94
-
95
- return () => {
96
- unsubscribeFromEventEmitter();
97
- unsubscribeFromThemeStore();
98
- };
99
- }, []);
100
-
101
- useEffect(() => {
102
- const { current: terminal } = terminalPanelRef;
103
-
104
- if (!terminal) {
105
- return;
106
- }
107
-
108
- const isCollapsed = terminal.isCollapsed();
109
-
110
- if (!showTerminal && !isCollapsed) {
111
- terminal.collapse();
112
- } else if (showTerminal && isCollapsed) {
113
- terminal.resize(DEFAULT_TERMINAL_SIZE);
114
- }
115
-
116
- terminalToggledByShortcut.current = false;
117
- }, [showTerminal]);
118
-
119
- const addTerminal = () => {
120
- if (terminalCount < MAX_TERMINALS) {
121
- setTerminalCount(terminalCount + 1);
122
- setActiveTerminal(terminalCount);
123
- }
124
- };
125
-
126
  return (
127
  <PanelGroup direction="vertical">
128
  <Panel defaultSize={showTerminal ? DEFAULT_EDITOR_SIZE : 100} minSize={20}>
@@ -181,118 +126,7 @@ export const EditorPanel = memo(
181
  </PanelGroup>
182
  </Panel>
183
  <PanelResizeHandle />
184
- <Panel
185
- ref={terminalPanelRef}
186
- defaultSize={showTerminal ? DEFAULT_TERMINAL_SIZE : 0}
187
- minSize={10}
188
- collapsible
189
- onExpand={() => {
190
- if (!terminalToggledByShortcut.current) {
191
- workbenchStore.toggleTerminal(true);
192
- }
193
- }}
194
- onCollapse={() => {
195
- if (!terminalToggledByShortcut.current) {
196
- workbenchStore.toggleTerminal(false);
197
- }
198
- }}
199
- >
200
- <div className="h-full">
201
- <div className="bg-bolt-elements-terminals-background h-full flex flex-col">
202
- <div className="flex items-center bg-bolt-elements-background-depth-2 border-y border-bolt-elements-borderColor gap-1.5 min-h-[34px] p-2">
203
- {Array.from({ length: terminalCount + 1 }, (_, index) => {
204
- const isActive = activeTerminal === index;
205
-
206
- return (
207
- <React.Fragment key={index}>
208
- {index == 0 ? (
209
- <button
210
- key={index}
211
- className={classNames(
212
- 'flex items-center text-sm cursor-pointer gap-1.5 px-3 py-2 h-full whitespace-nowrap rounded-full',
213
- {
214
- 'bg-bolt-elements-terminals-buttonBackground text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary':
215
- isActive,
216
- 'bg-bolt-elements-background-depth-2 text-bolt-elements-textSecondary hover:bg-bolt-elements-terminals-buttonBackground':
217
- !isActive,
218
- },
219
- )}
220
- onClick={() => setActiveTerminal(index)}
221
- >
222
- <div className="i-ph:terminal-window-duotone text-lg" />
223
- Bolt Terminal
224
- </button>
225
- ) : (
226
- <React.Fragment>
227
- <button
228
- key={index}
229
- className={classNames(
230
- 'flex items-center text-sm cursor-pointer gap-1.5 px-3 py-2 h-full whitespace-nowrap rounded-full',
231
- {
232
- 'bg-bolt-elements-terminals-buttonBackground text-bolt-elements-textPrimary': isActive,
233
- 'bg-bolt-elements-background-depth-2 text-bolt-elements-textSecondary hover:bg-bolt-elements-terminals-buttonBackground':
234
- !isActive,
235
- },
236
- )}
237
- onClick={() => setActiveTerminal(index)}
238
- >
239
- <div className="i-ph:terminal-window-duotone text-lg" />
240
- Terminal {terminalCount > 1 && index}
241
- </button>
242
- </React.Fragment>
243
- )}
244
- </React.Fragment>
245
- );
246
- })}
247
- {terminalCount < MAX_TERMINALS && <IconButton icon="i-ph:plus" size="md" onClick={addTerminal} />}
248
- <IconButton
249
- className="ml-auto"
250
- icon="i-ph:caret-down"
251
- title="Close"
252
- size="md"
253
- onClick={() => workbenchStore.toggleTerminal(false)}
254
- />
255
- </div>
256
- {Array.from({ length: terminalCount + 1 }, (_, index) => {
257
- const isActive = activeTerminal === index;
258
-
259
- if (index == 0) {
260
- logger.info('Starting bolt terminal');
261
-
262
- return (
263
- <Terminal
264
- key={index}
265
- className={classNames('h-full overflow-hidden', {
266
- hidden: !isActive,
267
- })}
268
- ref={(ref) => {
269
- terminalRefs.current.push(ref);
270
- }}
271
- onTerminalReady={(terminal) => workbenchStore.attachBoltTerminal(terminal)}
272
- onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
273
- theme={theme}
274
- />
275
- );
276
- }
277
-
278
- return (
279
- <Terminal
280
- key={index}
281
- className={classNames('h-full overflow-hidden', {
282
- hidden: !isActive,
283
- })}
284
- ref={(ref) => {
285
- terminalRefs.current.push(ref);
286
- }}
287
- onTerminalReady={(terminal) => workbenchStore.attachTerminal(terminal)}
288
- onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
289
- theme={theme}
290
- />
291
- );
292
- })}
293
- </div>
294
- </div>
295
- </Panel>
296
  </PanelGroup>
297
  );
298
  },
 
1
  import { useStore } from '@nanostores/react';
2
+ import { memo, useMemo } from 'react';
3
+ import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
4
  import {
5
  CodeMirrorEditor,
6
  type EditorDocument,
 
9
  type OnSaveCallback as OnEditorSave,
10
  type OnScrollCallback as OnEditorScroll,
11
  } from '~/components/editor/codemirror/CodeMirrorEditor';
 
12
  import { PanelHeader } from '~/components/ui/PanelHeader';
13
  import { PanelHeaderButton } from '~/components/ui/PanelHeaderButton';
 
14
  import type { FileMap } from '~/lib/stores/files';
15
  import { themeStore } from '~/lib/stores/theme';
 
 
16
  import { WORK_DIR } from '~/utils/constants';
17
+ import { renderLogger } from '~/utils/logger';
18
  import { isMobile } from '~/utils/mobile';
19
  import { FileBreadcrumb } from './FileBreadcrumb';
20
  import { FileTree } from './FileTree';
21
+ import { DEFAULT_TERMINAL_SIZE, TerminalTabs } from './terminal/TerminalTabs';
22
+ import { workbenchStore } from '~/lib/stores/workbench';
23
 
24
  interface EditorPanelProps {
25
  files?: FileMap;
 
34
  onFileReset?: () => void;
35
  }
36
 
 
 
37
  const DEFAULT_EDITOR_SIZE = 100 - DEFAULT_TERMINAL_SIZE;
38
 
39
  const editorSettings: EditorSettings = { tabSize: 2 };
 
56
  const theme = useStore(themeStore);
57
  const showTerminal = useStore(workbenchStore.showTerminal);
58
 
 
 
 
 
 
 
 
59
  const activeFileSegments = useMemo(() => {
60
  if (!editorDocument) {
61
  return undefined;
 
68
  return editorDocument !== undefined && unsavedFiles?.has(editorDocument.filePath);
69
  }, [editorDocument, unsavedFiles]);
70
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  return (
72
  <PanelGroup direction="vertical">
73
  <Panel defaultSize={showTerminal ? DEFAULT_EDITOR_SIZE : 100} minSize={20}>
 
126
  </PanelGroup>
127
  </Panel>
128
  <PanelResizeHandle />
129
+ <TerminalTabs />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
130
  </PanelGroup>
131
  );
132
  },
app/components/workbench/terminal/Terminal.tsx CHANGED
@@ -16,71 +16,74 @@ export interface TerminalProps {
16
  className?: string;
17
  theme: Theme;
18
  readonly?: boolean;
 
19
  onTerminalReady?: (terminal: XTerm) => void;
20
  onTerminalResize?: (cols: number, rows: number) => void;
21
  }
22
 
23
  export const Terminal = memo(
24
- forwardRef<TerminalRef, TerminalProps>(({ className, theme, readonly, onTerminalReady, onTerminalResize }, ref) => {
25
- const terminalElementRef = useRef<HTMLDivElement>(null);
26
- const terminalRef = useRef<XTerm>();
27
-
28
- useEffect(() => {
29
- const element = terminalElementRef.current!;
30
-
31
- const fitAddon = new FitAddon();
32
- const webLinksAddon = new WebLinksAddon();
33
-
34
- const terminal = new XTerm({
35
- cursorBlink: true,
36
- convertEol: true,
37
- disableStdin: readonly,
38
- theme: getTerminalTheme(readonly ? { cursor: '#00000000' } : {}),
39
- fontSize: 12,
40
- fontFamily: 'Menlo, courier-new, courier, monospace',
41
- });
42
-
43
- terminalRef.current = terminal;
44
-
45
- terminal.loadAddon(fitAddon);
46
- terminal.loadAddon(webLinksAddon);
47
- terminal.open(element);
48
-
49
- const resizeObserver = new ResizeObserver(() => {
50
- fitAddon.fit();
51
- onTerminalResize?.(terminal.cols, terminal.rows);
52
- });
53
-
54
- resizeObserver.observe(element);
55
-
56
- logger.info('Attach terminal');
57
-
58
- onTerminalReady?.(terminal);
59
-
60
- return () => {
61
- resizeObserver.disconnect();
62
- terminal.dispose();
63
- };
64
- }, []);
65
-
66
- useEffect(() => {
67
- const terminal = terminalRef.current!;
68
-
69
- // we render a transparent cursor in case the terminal is readonly
70
- terminal.options.theme = getTerminalTheme(readonly ? { cursor: '#00000000' } : {});
71
-
72
- terminal.options.disableStdin = readonly;
73
- }, [theme, readonly]);
74
-
75
- useImperativeHandle(ref, () => {
76
- return {
77
- reloadStyles: () => {
78
- const terminal = terminalRef.current!;
79
- terminal.options.theme = getTerminalTheme(readonly ? { cursor: '#00000000' } : {});
80
- },
81
- };
82
- }, []);
83
-
84
- return <div className={className} ref={terminalElementRef} />;
85
- }),
 
 
86
  );
 
16
  className?: string;
17
  theme: Theme;
18
  readonly?: boolean;
19
+ id: string;
20
  onTerminalReady?: (terminal: XTerm) => void;
21
  onTerminalResize?: (cols: number, rows: number) => void;
22
  }
23
 
24
  export const Terminal = memo(
25
+ forwardRef<TerminalRef, TerminalProps>(
26
+ ({ className, theme, readonly, id, onTerminalReady, onTerminalResize }, ref) => {
27
+ const terminalElementRef = useRef<HTMLDivElement>(null);
28
+ const terminalRef = useRef<XTerm>();
29
+
30
+ useEffect(() => {
31
+ const element = terminalElementRef.current!;
32
+
33
+ const fitAddon = new FitAddon();
34
+ const webLinksAddon = new WebLinksAddon();
35
+
36
+ const terminal = new XTerm({
37
+ cursorBlink: true,
38
+ convertEol: true,
39
+ disableStdin: readonly,
40
+ theme: getTerminalTheme(readonly ? { cursor: '#00000000' } : {}),
41
+ fontSize: 12,
42
+ fontFamily: 'Menlo, courier-new, courier, monospace',
43
+ });
44
+
45
+ terminalRef.current = terminal;
46
+
47
+ terminal.loadAddon(fitAddon);
48
+ terminal.loadAddon(webLinksAddon);
49
+ terminal.open(element);
50
+
51
+ const resizeObserver = new ResizeObserver(() => {
52
+ fitAddon.fit();
53
+ onTerminalResize?.(terminal.cols, terminal.rows);
54
+ });
55
+
56
+ resizeObserver.observe(element);
57
+
58
+ logger.debug(`Attach [${id}]`);
59
+
60
+ onTerminalReady?.(terminal);
61
+
62
+ return () => {
63
+ resizeObserver.disconnect();
64
+ terminal.dispose();
65
+ };
66
+ }, []);
67
+
68
+ useEffect(() => {
69
+ const terminal = terminalRef.current!;
70
+
71
+ // we render a transparent cursor in case the terminal is readonly
72
+ terminal.options.theme = getTerminalTheme(readonly ? { cursor: '#00000000' } : {});
73
+
74
+ terminal.options.disableStdin = readonly;
75
+ }, [theme, readonly]);
76
+
77
+ useImperativeHandle(ref, () => {
78
+ return {
79
+ reloadStyles: () => {
80
+ const terminal = terminalRef.current!;
81
+ terminal.options.theme = getTerminalTheme(readonly ? { cursor: '#00000000' } : {});
82
+ },
83
+ };
84
+ }, []);
85
+
86
+ return <div className={className} ref={terminalElementRef} />;
87
+ },
88
+ ),
89
  );
app/components/workbench/terminal/TerminalTabs.tsx ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { useStore } from '@nanostores/react';
2
+ import React, { memo, useEffect, useRef, useState } from 'react';
3
+ import { Panel, type ImperativePanelHandle } from 'react-resizable-panels';
4
+ import { IconButton } from '~/components/ui/IconButton';
5
+ import { shortcutEventEmitter } from '~/lib/hooks';
6
+ import { themeStore } from '~/lib/stores/theme';
7
+ import { workbenchStore } from '~/lib/stores/workbench';
8
+ import { classNames } from '~/utils/classNames';
9
+ import { Terminal, type TerminalRef } from './Terminal';
10
+ import { createScopedLogger } from '~/utils/logger';
11
+
12
+ const logger = createScopedLogger('Terminal');
13
+
14
+ const MAX_TERMINALS = 3;
15
+ export const DEFAULT_TERMINAL_SIZE = 25;
16
+
17
+ export const TerminalTabs = memo(() => {
18
+ const showTerminal = useStore(workbenchStore.showTerminal);
19
+ const theme = useStore(themeStore);
20
+
21
+ const terminalRefs = useRef<Array<TerminalRef | null>>([]);
22
+ const terminalPanelRef = useRef<ImperativePanelHandle>(null);
23
+ const terminalToggledByShortcut = useRef(false);
24
+
25
+ const [activeTerminal, setActiveTerminal] = useState(0);
26
+ const [terminalCount, setTerminalCount] = useState(1);
27
+
28
+ const addTerminal = () => {
29
+ if (terminalCount < MAX_TERMINALS) {
30
+ setTerminalCount(terminalCount + 1);
31
+ setActiveTerminal(terminalCount);
32
+ }
33
+ };
34
+
35
+ useEffect(() => {
36
+ const { current: terminal } = terminalPanelRef;
37
+
38
+ if (!terminal) {
39
+ return;
40
+ }
41
+
42
+ const isCollapsed = terminal.isCollapsed();
43
+
44
+ if (!showTerminal && !isCollapsed) {
45
+ terminal.collapse();
46
+ } else if (showTerminal && isCollapsed) {
47
+ terminal.resize(DEFAULT_TERMINAL_SIZE);
48
+ }
49
+
50
+ terminalToggledByShortcut.current = false;
51
+ }, [showTerminal]);
52
+
53
+ useEffect(() => {
54
+ const unsubscribeFromEventEmitter = shortcutEventEmitter.on('toggleTerminal', () => {
55
+ terminalToggledByShortcut.current = true;
56
+ });
57
+
58
+ const unsubscribeFromThemeStore = themeStore.subscribe(() => {
59
+ for (const ref of Object.values(terminalRefs.current)) {
60
+ ref?.reloadStyles();
61
+ }
62
+ });
63
+
64
+ return () => {
65
+ unsubscribeFromEventEmitter();
66
+ unsubscribeFromThemeStore();
67
+ };
68
+ }, []);
69
+
70
+ return (
71
+ <Panel
72
+ ref={terminalPanelRef}
73
+ defaultSize={showTerminal ? DEFAULT_TERMINAL_SIZE : 0}
74
+ minSize={10}
75
+ collapsible
76
+ onExpand={() => {
77
+ if (!terminalToggledByShortcut.current) {
78
+ workbenchStore.toggleTerminal(true);
79
+ }
80
+ }}
81
+ onCollapse={() => {
82
+ if (!terminalToggledByShortcut.current) {
83
+ workbenchStore.toggleTerminal(false);
84
+ }
85
+ }}
86
+ >
87
+ <div className="h-full">
88
+ <div className="bg-bolt-elements-terminals-background h-full flex flex-col">
89
+ <div className="flex items-center bg-bolt-elements-background-depth-2 border-y border-bolt-elements-borderColor gap-1.5 min-h-[34px] p-2">
90
+ {Array.from({ length: terminalCount + 1 }, (_, index) => {
91
+ const isActive = activeTerminal === index;
92
+
93
+ return (
94
+ <React.Fragment key={index}>
95
+ {index == 0 ? (
96
+ <button
97
+ key={index}
98
+ className={classNames(
99
+ 'flex items-center text-sm cursor-pointer gap-1.5 px-3 py-2 h-full whitespace-nowrap rounded-full',
100
+ {
101
+ 'bg-bolt-elements-terminals-buttonBackground text-bolt-elements-textSecondary hover:text-bolt-elements-textPrimary':
102
+ isActive,
103
+ 'bg-bolt-elements-background-depth-2 text-bolt-elements-textSecondary hover:bg-bolt-elements-terminals-buttonBackground':
104
+ !isActive,
105
+ },
106
+ )}
107
+ onClick={() => setActiveTerminal(index)}
108
+ >
109
+ <div className="i-ph:terminal-window-duotone text-lg" />
110
+ Bolt Terminal
111
+ </button>
112
+ ) : (
113
+ <React.Fragment>
114
+ <button
115
+ key={index}
116
+ className={classNames(
117
+ 'flex items-center text-sm cursor-pointer gap-1.5 px-3 py-2 h-full whitespace-nowrap rounded-full',
118
+ {
119
+ 'bg-bolt-elements-terminals-buttonBackground text-bolt-elements-textPrimary': isActive,
120
+ 'bg-bolt-elements-background-depth-2 text-bolt-elements-textSecondary hover:bg-bolt-elements-terminals-buttonBackground':
121
+ !isActive,
122
+ },
123
+ )}
124
+ onClick={() => setActiveTerminal(index)}
125
+ >
126
+ <div className="i-ph:terminal-window-duotone text-lg" />
127
+ Terminal {terminalCount > 1 && index}
128
+ </button>
129
+ </React.Fragment>
130
+ )}
131
+ </React.Fragment>
132
+ );
133
+ })}
134
+ {terminalCount < MAX_TERMINALS && <IconButton icon="i-ph:plus" size="md" onClick={addTerminal} />}
135
+ <IconButton
136
+ className="ml-auto"
137
+ icon="i-ph:caret-down"
138
+ title="Close"
139
+ size="md"
140
+ onClick={() => workbenchStore.toggleTerminal(false)}
141
+ />
142
+ </div>
143
+ {Array.from({ length: terminalCount + 1 }, (_, index) => {
144
+ const isActive = activeTerminal === index;
145
+
146
+ logger.debug(`Starting bolt terminal [${index}]`);
147
+
148
+ if (index == 0) {
149
+ return (
150
+ <Terminal
151
+ key={index}
152
+ id={`terminal_${index}`}
153
+ className={classNames('h-full overflow-hidden', {
154
+ hidden: !isActive,
155
+ })}
156
+ ref={(ref) => {
157
+ terminalRefs.current.push(ref);
158
+ }}
159
+ onTerminalReady={(terminal) => workbenchStore.attachBoltTerminal(terminal)}
160
+ onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
161
+ theme={theme}
162
+ />
163
+ );
164
+ } else {
165
+ return (
166
+ <Terminal
167
+ key={index}
168
+ id={`terminal_${index}`}
169
+ className={classNames('h-full overflow-hidden', {
170
+ hidden: !isActive,
171
+ })}
172
+ ref={(ref) => {
173
+ terminalRefs.current.push(ref);
174
+ }}
175
+ onTerminalReady={(terminal) => workbenchStore.attachTerminal(terminal)}
176
+ onTerminalResize={(cols, rows) => workbenchStore.onTerminalResize(cols, rows)}
177
+ theme={theme}
178
+ />
179
+ );
180
+ }
181
+ })}
182
+ </div>
183
+ </div>
184
+ </Panel>
185
+ );
186
+ });
app/lib/.server/llm/api-key.ts CHANGED
@@ -35,6 +35,8 @@ export function getAPIKey(cloudflareEnv: Env, provider: string, userApiKeys?: Re
35
  return env.MISTRAL_API_KEY || cloudflareEnv.MISTRAL_API_KEY;
36
  case 'OpenAILike':
37
  return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
 
 
38
  case 'xAI':
39
  return env.XAI_API_KEY || cloudflareEnv.XAI_API_KEY;
40
  case 'Cohere':
@@ -48,6 +50,8 @@ export function getAPIKey(cloudflareEnv: Env, provider: string, userApiKeys?: Re
48
 
49
  export function getBaseURL(cloudflareEnv: Env, provider: string) {
50
  switch (provider) {
 
 
51
  case 'OpenAILike':
52
  return env.OPENAI_LIKE_API_BASE_URL || cloudflareEnv.OPENAI_LIKE_API_BASE_URL;
53
  case 'LMStudio':
 
35
  return env.MISTRAL_API_KEY || cloudflareEnv.MISTRAL_API_KEY;
36
  case 'OpenAILike':
37
  return env.OPENAI_LIKE_API_KEY || cloudflareEnv.OPENAI_LIKE_API_KEY;
38
+ case 'Together':
39
+ return env.TOGETHER_API_KEY || cloudflareEnv.TOGETHER_API_KEY;
40
  case 'xAI':
41
  return env.XAI_API_KEY || cloudflareEnv.XAI_API_KEY;
42
  case 'Cohere':
 
50
 
51
  export function getBaseURL(cloudflareEnv: Env, provider: string) {
52
  switch (provider) {
53
+ case 'Together':
54
+ return env.TOGETHER_API_BASE_URL || cloudflareEnv.TOGETHER_API_BASE_URL;
55
  case 'OpenAILike':
56
  return env.OPENAI_LIKE_API_BASE_URL || cloudflareEnv.OPENAI_LIKE_API_BASE_URL;
57
  case 'LMStudio':
app/lib/.server/llm/model.ts CHANGED
@@ -146,6 +146,8 @@ export function getModel(provider: string, model: string, env: Env, apiKeys?: Re
146
  return getGoogleModel(apiKey, model);
147
  case 'OpenAILike':
148
  return getOpenAILikeModel(baseURL, apiKey, model);
 
 
149
  case 'Deepseek':
150
  return getDeepseekModel(apiKey, model);
151
  case 'Mistral':
 
146
  return getGoogleModel(apiKey, model);
147
  case 'OpenAILike':
148
  return getOpenAILikeModel(baseURL, apiKey, model);
149
+ case 'Together':
150
+ return getOpenAILikeModel(baseURL, apiKey, model);
151
  case 'Deepseek':
152
  return getDeepseekModel(apiKey, model);
153
  case 'Mistral':
app/utils/constants.ts CHANGED
@@ -260,6 +260,23 @@ const PROVIDER_LIST: ProviderInfo[] = [
260
  labelForGetApiKey: 'Get LMStudio',
261
  icon: 'i-ph:cloud-arrow-down',
262
  },
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  ];
264
 
265
  export const DEFAULT_PROVIDER = PROVIDER_LIST[0];
 
260
  labelForGetApiKey: 'Get LMStudio',
261
  icon: 'i-ph:cloud-arrow-down',
262
  },
263
+ {
264
+ name: 'Together',
265
+ staticModels: [
266
+
267
+ { name: 'Qwen/Qwen2.5-Coder-32B-Instruct', label: 'Qwen/Qwen2.5-Coder-32B-Instruct', provider: 'Together', maxTokenAllowed: 8000, },
268
+ {
269
+ name: 'meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo',
270
+ label: 'meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo',
271
+ provider: 'Together',
272
+ maxTokenAllowed: 8000,
273
+ },
274
+
275
+ { name: 'mistralai/Mixtral-8x7B-Instruct-v0.1', label: 'Mixtral 8x7B Instruct', provider: 'Together', maxTokenAllowed: 8192 },
276
+
277
+ ],
278
+ getApiKeyLink: 'https://api.together.xyz/settings/api-keys',
279
+ },
280
  ];
281
 
282
  export const DEFAULT_PROVIDER = PROVIDER_LIST[0];
docker-compose.yaml CHANGED
@@ -11,7 +11,7 @@ services:
11
  environment:
12
  - NODE_ENV=production
13
  - COMPOSE_PROFILES=production
14
- # No strictly neded but serving as hints for Coolify
15
  - PORT=5173
16
  - GROQ_API_KEY=${GROQ_API_KEY}
17
  - HuggingFace_API_KEY=${HuggingFace_API_KEY}
@@ -20,6 +20,8 @@ services:
20
  - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
21
  - GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY}
22
  - OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL}
 
 
23
  - VITE_LOG_LEVEL=${VITE_LOG_LEVEL:-debug}
24
  - DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX:-32768}
25
  - RUNNING_IN_DOCKER=true
@@ -48,6 +50,8 @@ services:
48
  - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
49
  - GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY}
50
  - OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL}
 
 
51
  - VITE_LOG_LEVEL=${VITE_LOG_LEVEL:-debug}
52
  - DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX:-32768}
53
  - RUNNING_IN_DOCKER=true
 
11
  environment:
12
  - NODE_ENV=production
13
  - COMPOSE_PROFILES=production
14
+ # No strictly needed but serving as hints for Coolify
15
  - PORT=5173
16
  - GROQ_API_KEY=${GROQ_API_KEY}
17
  - HuggingFace_API_KEY=${HuggingFace_API_KEY}
 
20
  - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
21
  - GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY}
22
  - OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL}
23
+ - TOGETHER_API_KEY=${TOGETHER_API_KEY}
24
+ - TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL}
25
  - VITE_LOG_LEVEL=${VITE_LOG_LEVEL:-debug}
26
  - DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX:-32768}
27
  - RUNNING_IN_DOCKER=true
 
50
  - OPEN_ROUTER_API_KEY=${OPEN_ROUTER_API_KEY}
51
  - GOOGLE_GENERATIVE_AI_API_KEY=${GOOGLE_GENERATIVE_AI_API_KEY}
52
  - OLLAMA_API_BASE_URL=${OLLAMA_API_BASE_URL}
53
+ - TOGETHER_API_KEY=${TOGETHER_API_KEY}
54
+ - TOGETHER_API_BASE_URL=${TOGETHER_API_BASE_URL}
55
  - VITE_LOG_LEVEL=${VITE_LOG_LEVEL:-debug}
56
  - DEFAULT_NUM_CTX=${DEFAULT_NUM_CTX:-32768}
57
  - RUNNING_IN_DOCKER=true
package.json CHANGED
@@ -1,6 +1,6 @@
1
  {
2
  "name": "bolt",
3
- "description": "StackBlitz AI Agent",
4
  "private": true,
5
  "license": "MIT",
6
  "sideEffects": false,
@@ -13,7 +13,9 @@
13
  "test:watch": "vitest",
14
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint app",
15
  "lint:fix": "npm run lint -- --fix && prettier app --write",
16
- "start": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
 
 
17
  "dockerstart": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 5173 --no-show-interactive-dev-session",
18
  "dockerrun": "docker run -it -d --name bolt-ai-live -p 5173:5173 --env-file .env.local bolt-ai",
19
  "dockerbuild:prod": "docker build -t bolt-ai:production -t bolt-ai:latest --target bolt-ai-production .",
 
1
  {
2
  "name": "bolt",
3
+ "description": "An AI Agent",
4
  "private": true,
5
  "license": "MIT",
6
  "sideEffects": false,
 
13
  "test:watch": "vitest",
14
  "lint": "eslint --cache --cache-location ./node_modules/.cache/eslint app",
15
  "lint:fix": "npm run lint -- --fix && prettier app --write",
16
+ "start:windows": "wrangler pages dev ./build/client",
17
+ "start:unix": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings",
18
+ "start": "node -e \"const { spawn } = require('child_process'); const isWindows = process.platform === 'win32'; const cmd = isWindows ? 'npm run start:windows' : 'npm run start:unix'; const child = spawn(cmd, { shell: true, stdio: 'inherit' }); child.on('exit', code => process.exit(code));\"",
19
  "dockerstart": "bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 5173 --no-show-interactive-dev-session",
20
  "dockerrun": "docker run -it -d --name bolt-ai-live -p 5173:5173 --env-file .env.local bolt-ai",
21
  "dockerbuild:prod": "docker build -t bolt-ai:production -t bolt-ai:latest --target bolt-ai-production .",
worker-configuration.d.ts CHANGED
@@ -7,6 +7,8 @@ interface Env {
7
  OLLAMA_API_BASE_URL: string;
8
  OPENAI_LIKE_API_KEY: string;
9
  OPENAI_LIKE_API_BASE_URL: string;
 
 
10
  DEEPSEEK_API_KEY: string;
11
  LMSTUDIO_API_BASE_URL: string;
12
  GOOGLE_GENERATIVE_AI_API_KEY: string;
 
7
  OLLAMA_API_BASE_URL: string;
8
  OPENAI_LIKE_API_KEY: string;
9
  OPENAI_LIKE_API_BASE_URL: string;
10
+ TOGETHER_API_KEY: string;
11
+ TOGETHER_API_BASE_URL: string;
12
  DEEPSEEK_API_KEY: string;
13
  LMSTUDIO_API_BASE_URL: string;
14
  GOOGLE_GENERATIVE_AI_API_KEY: string;