Skip to content

Commit da0662b

Browse files
authored
Merge pull request #1606 from endolith/server
Remove duplicate server init, add server info prints
2 parents 7fe61da + 737d603 commit da0662b

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

interpreter/cli.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ async def async_load_interpreter(args):
186186
async def async_main(args):
187187
global global_interpreter
188188

189-
if args["serve"]:
190-
global_interpreter = await async_load_interpreter(args)
191-
print("Starting server...")
192-
global_interpreter.server()
193-
return
194-
195189
if (
196190
args["input"] is None
197191
and sys.stdin.isatty()

interpreter/interpreter.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,21 @@ def server(self):
10731073
# Create and start server
10741074
server = Server(self)
10751075
try:
1076+
host = server.host
1077+
port = server.port
1078+
1079+
print("\n" + "=" * 60)
1080+
print(f"Open Interpreter API Server")
1081+
print("=" * 60)
1082+
print("\nTo use with an OpenAI-compatible client, configure:")
1083+
print(f" - API Base: http://{host}:{port}")
1084+
print(f" - API Path: /chat/completions")
1085+
print(f" - API Key: (any value, authentication not required)")
1086+
print(f" - Model name: (any value, ignored)")
1087+
print("\nNOTE: The server will use the model configured in --model")
1088+
print(f" Currently using: {self.model}")
1089+
print("=" * 60 + "\n")
1090+
10761091
server.run()
10771092
except KeyboardInterrupt:
10781093
print("\nShutting down server...")

0 commit comments

Comments
 (0)