Skip to main content

Run a Model

import commune as c
c.jupyter()
# search modules for the openai module
c.modules('model.openai')
model = c.module('model.openai')(api_key='YOUR_API_KEY')
model.forward('whadup')
# oops it was the wrong key, lets add the right one
model.set_api_key('sk-gp5QMj')
model.forward('whadup')
model.serve(tag='whadup')
client = c.connect('model.openai::whadup')
client.forward('whadup')
# get the schema of the server
schema = client.schema()
c.print(schema)
client_info = client.info()
c.print(client_info)
c.kill('model.openai::whadup')
c.pm2ls()