Skip to content

Commit 737d603

Browse files
committed
Print helpful OpenAI-compatible server info
Example: ````shell (oi_dev) λ interpreter --serve --model gpt-4o-mini --auto-run Starting OpenAI-compatible server... ============================================================ Open Interpreter API Server ============================================================ To use with an OpenAI-compatible client, configure: - API Base: http://127.0.0.1:8000 - API Path: /chat/completions - API Key: (any value, authentication not required) - Model name: (any value, ignored) NOTE: The server will use the model configured in --model Currently using: gpt-4o-mini ============================================================ ````
1 parent 568502e commit 737d603

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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)