feat: added support for open source models, added instructions to docs
diff --git a/README.md b/README.md
index 9d7325e548..ddc8087c50 100644
--- a/README.md
+++ b/README.md
@@ -81,6 +81,16 @@ Editing the `preprompts`, and evolving how you write the project prompt, is how
 
 Each step in `steps.py` will have its communication history with GPT4 stored in the logs folder, and can be rerun with `scripts/rerun_edited_message_logs.py`.
 
+### Running with open source models
+
+You can use gpt-engineer with open source models by using an OpenAI compatible API, such as the one offered by the [text-generator-ui extension `openai`](https://github.com/oobabooga/text-generation-webui/blob/main/extensions/openai/README.md). This can easily be setup with [TheBloke's Runpod template](https://www.runpod.io/console/gpu-secure-cloud?template=f1pf20op0z).
+
+To do so, first set up the API according to the instructions linked above. Then you need to go into the text-generation-webui, go to settings, check the `openai` extension, save. You then need to expose TCP port 5001 in your Runpod config, which will give it an exposed TCP port something like 40125. Then restart your Runpod, and check that the API is live by browsing: http://<public ip>:<port>/v1/models
+
+Then, as an example we can now run it with WizardCoder-Python-34B hosted on Runpod: `OPENAI_API_BASE=http://<host>:<port>/v1 python -m gpt_engineer.main benchmark/pomodoro_timer --steps benchmark TheBloke_WizardCoder-Python-34B-V1.0-GPTQ`
+
+Check your Runpod dashboard for the host and (exposed TCP) port, mine was something like 40125.
+
 ## Vision
 The gpt-engineer community is building the **open platform for devs to tinker with and build their personal code-generation toolbox**.
 
diff --git a/gpt_engineer/ai.py b/gpt_engineer/ai.py
index e801f4d3ec..e60e11eba0 100644
--- a/gpt_engineer/ai.py
+++ b/gpt_engineer/ai.py
@@ -365,22 +365,19 @@ def create_chat_model(self, model: str, temperature) -> BaseChatModel:
             streaming=True,
             # tiktoken_model_name
         )
-    if model == "gpt-4":
+    # Fetch available models from OpenAI API
+    supported = [model["id"] for model in openai.Model.list()["data"]]
+    if model in supported:
         return ChatOpenAI(
-            model="gpt-4",
-            temperature=temperature,
-            streaming=True,
-            client=openai.ChatCompletion,
-        )
-    elif model == "gpt-3.5-turbo":
-        return ChatOpenAI(
-            model="gpt-3.5-turbo",
+            model=model,
             temperature=temperature,
             streaming=True,
             client=openai.ChatCompletion,
         )
     else:
-        raise ValueError(f"Model {model} is not supported.")
+        raise ValueError(
+            f"Model {model} is not supported, supported models are: {supported}"
+        )
 
 
 def get_tokenizer(model: str):

Hi @AntonOsika,

Thought I'd give the new WizardCoder models a go, they are pretty impressive!

I was going to try and run the benchmarks, but it was a bit finicky, so I did this instead :)