Skip to content

Commit a46a27a

Browse files
committed
Local III
1 parent acda10d commit a46a27a

File tree

6 files changed

+53
-5
lines changed

6 files changed

+53
-5
lines changed

interpreter/terminal_interface/profiles/defaults/codestral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
4646
NEVER use placeholders, NEVER say "path/to/desktop", NEVER say "path/to/file". Always specify exact paths, and use cross-platform ways of determining the desktop, documents, cwd, etc. folders.
4747
48-
Now, your turn:"""
48+
Now, your turn:""".strip()
4949

5050
# Message templates
5151
interpreter.code_output_template = '''I executed that code. This was the output: """{content}"""\n\nWhat does this output mean (I can't understand it, please help) / what code needs to be run next (if anything, or are we done)? I can't replace any placeholders.'''

interpreter/terminal_interface/profiles/defaults/llama3-vision.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
5757
NEVER use placeholders. Always specify exact paths, and use cross-platform ways of determining the desktop, documents, etc. folders.
5858
59-
Now, your turn:"""
59+
Now, your turn:""".strip()
6060

6161
# Message templates
6262
interpreter.code_output_template = '''I executed that code. This was the output: """{content}"""\n\nWhat does this output mean (I can't understand it, please help) / what code needs to be run next (if anything, or are we done)? I can't replace any placeholders.'''

interpreter/terminal_interface/profiles/defaults/llama3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@
1717
User: The code you ran produced no output. Was this expected, or are we finished?
1818
Assistant: No further action is required; the provided snippet opens Chrome.
1919
20-
Now, your turn:"""
20+
Now, your turn:""".strip()
2121

2222
# Message templates
2323
interpreter.code_output_template = '''I executed that code. This was the output: """{content}"""\n\nWhat does this output mean (I can't understand it, please help) / what code needs to be run next (if anything, or are we done)? I can't replace any placeholders.'''
2424
interpreter.empty_code_output_template = "The code above was executed on my machine. It produced no text output. What's next (if anything, or are we done?)"
2525
interpreter.code_output_sender = "user"
2626

2727
# LLM settings
28-
interpreter.llm.model = "ollama/codestral"
28+
interpreter.llm.model = "ollama/llama3"
2929
interpreter.llm.supports_functions = False
3030
interpreter.llm.execution_instructions = False
3131
interpreter.llm.max_tokens = 1000

interpreter/terminal_interface/profiles/defaults/local.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
User: The code you ran produced no output. Was this expected, or are we finished?
1515
Assistant: No further action is required; the provided snippet opens Chrome.
1616
17-
Now, your turn:"""
17+
Now, your turn:""".strip()
1818

1919
# Message templates
2020
interpreter.code_output_template = '''I executed that code. This was the output: """{content}"""\n\nWhat does this output mean (I can't understand it, please help) / what code needs to be run next (if anything, or are we done)? I can't replace any placeholders.'''
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
"""
2+
This is an Open Interpreter profile. It configures Open Interpreter to run `qwen` using Ollama.
3+
"""
4+
5+
from interpreter import interpreter
6+
7+
interpreter.system_message = """You are an AI assistant that writes tiny markdown code snippets to answer the user's request. You speak very concisely and quickly, you say nothing irrelevant to the user's request. For example:
8+
9+
User: Open the chrome app.
10+
Assistant: On it.
11+
```python
12+
import webbrowser
13+
webbrowser.open('https://chrome.google.com')
14+
```
15+
User: The code you ran produced no output. Was this expected, or are we finished?
16+
Assistant: No further action is required; the provided snippet opens Chrome.
17+
18+
Now, your turn:""".strip()
19+
20+
# Message templates
21+
interpreter.code_output_template = """I executed that code. This was the output: \n\n{content}\n\nWhat does this output mean? I can't understand it, please help / what code needs to be run next (if anything, or are we done with my query)?"""
22+
interpreter.empty_code_output_template = "I executed your code snippet. It produced no text output. What's next (if anything, or are we done?)"
23+
interpreter.user_message_template = (
24+
"Write a ```python code snippet that would answer this query: `{content}`"
25+
)
26+
interpreter.code_output_sender = "user"
27+
28+
# LLM settings
29+
interpreter.llm.model = "ollama/qwen2:1.5b"
30+
interpreter.llm.supports_functions = False
31+
interpreter.llm.execution_instructions = False
32+
interpreter.llm.max_tokens = 1000
33+
interpreter.llm.context_window = 7000
34+
interpreter.llm.load() # Loads Ollama models
35+
36+
# Computer settings
37+
interpreter.computer.import_computer_api = False
38+
39+
# Misc settings
40+
interpreter.auto_run = True
41+
interpreter.offline = True
42+
43+
# Final message
44+
interpreter.display_message(
45+
"> Model set to `qwen`\n\n**Open Interpreter** will require approval before running code.\n\nUse `interpreter -y` to bypass this.\n\nPress `CTRL-C` to exit.\n"
46+
)

interpreter/terminal_interface/validate_llm_settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ def validate_llm_settings(interpreter):
9797
interpreter.display_message(
9898
"***Note:*** *Conversations with this model will be used to train our open-source model.*\n"
9999
)
100+
if "ollama" in interpreter.llm.model:
101+
interpreter.llm.load()
100102
return
101103

102104

0 commit comments

Comments
 (0)