The computer itself is separate from Open Interpreter’s core, so you can run it independently:
Copy
Ask AI
from interpreter import interpreterinterpreter.computer.run("python", "print('Hello World!')")
This runs in the same Python instance that interpreter uses, so you can define functions, variables, or log in to services before the AI starts running code:
Copy
Ask AI
interpreter.computer.run("python", "import replicate\nreplicate.api_key='...'")interpreter.custom_instructions = "Replicate has already been imported."interpreter.chat("Please generate an image on replicate...") # Interpreter will be logged into Replicate