From 2eb0be5d2ae0ba21272a918a3fff41cb99403c52 Mon Sep 17 00:00:00 2001 From: Pieter Steyn Date: Fri, 13 Dec 2024 11:49:12 +0200 Subject: [PATCH 1/2] Add basic instructions for using xAI Grok. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 31770042..9d7f70f0 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,15 @@ By default, ShellGPT uses OpenAI's API and GPT-4 model. You'll need an API key, > [!TIP] > Alternatively, you can use locally hosted open source models which are available for free. To use local models, you will need to run your own LLM backend server such as [Ollama](https://github.com/ollama/ollama). To set up ShellGPT with Ollama, please follow this comprehensive [guide](https://github.com/TheR1D/shell_gpt/wiki/Ollama). > +> xAI Grok also maintains some level of backwards compatability with the OpenAI API. +> You may use an xAI token with Grok2 like so +``` +export OPENAI_API_KEY='xai-xxxx' +export DEFAULT_MODEL="grok-beta" #Or whatever model is listed at the time, and preferred. +export API_BASE_URL=https://api.x.ai/v1 +``` +> Basic testing done, but *your mileage may vary*. + > **❗️Note that ShellGPT is not optimized for local models and may not work as expected.** ## Usage From 7e7b81c1d63c6831fdc420523ab3b86cfc7f7724 Mon Sep 17 00:00:00 2001 From: Pieter Steyn Date: Fri, 13 Dec 2024 11:56:41 +0200 Subject: [PATCH 2/2] Fix wording. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9d7f70f0..4fc0a323 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ By default, ShellGPT uses OpenAI's API and GPT-4 model. You'll need an API key, > [!TIP] > Alternatively, you can use locally hosted open source models which are available for free. To use local models, you will need to run your own LLM backend server such as [Ollama](https://github.com/ollama/ollama). To set up ShellGPT with Ollama, please follow this comprehensive [guide](https://github.com/TheR1D/shell_gpt/wiki/Ollama). > -> xAI Grok also maintains some level of backwards compatability with the OpenAI API. +> xAI Grok also maintains backwards compatability with the OpenAI API. > You may use an xAI token with Grok2 like so ``` export OPENAI_API_KEY='xai-xxxx'