autogen/website/blog/2023-07-14-Local-LLMs/index.md
Interact with model using `oai.Completion` (requires openai<1)  Now the models can be directly accessed through openai-python library as well as `autogen.oai.Completion` and `autogen.oai.ChatCompletion`.   ```python from autogen import oai  # create a text completion request response = oai.Completion.create(     config_list=[         {             "model": "chatglm2-6b",             "base_url": "http://localhost:8000/v1",             "api_type": "openai",             "api_key": "NULL", # just a placeholder         }     ],     prompt="Hi", ) print(response)  # create a chat completion request response = oai.ChatCompletion.create(     config_list=[         {             "model": "chatglm2-6b",             "base_url": "http://localhost:8000/v1",             "api_type": "openai",             "api_key": "NULL",         }     ],     messages=[{"role": "user", "content": "Hi"}] ) print(response) ```  If you would like to switch to different models, download their checkpoints and specify model path when launching model worker(s). 