diff --git a/README.org b/README.org index df3b70e1..9598ca1a 100644 --- a/README.org +++ b/README.org @@ -27,6 +27,7 @@ gptel is a simple Large Language Model chat client for Emacs, with support for m | Cerebras | ✓ | [[https://cloud.cerebras.ai/][API key]] | | Github Models | ✓ | [[https://github.com/settings/tokens][Token]] | | Novita AI | ✓ | [[https://novita.ai/model-api/product/llm-api?utm_source=github_gptel&utm_medium=github_readme&utm_campaign=link][Token]] | +| xAI | ✓ | [[https://console.x.ai?utm_source=github_gptel&utm_medium=github_readme&utm_campaign=link][API key]] | #+html: *General usage*: ([[https://www.youtube.com/watch?v=bsRnh_brggM][YouTube Demo]]) @@ -81,6 +82,7 @@ gptel uses Curl if available, but falls back to url-retrieve to work without ext - [[#cerebras][Cerebras]] - [[#github-models][Github Models]] - [[#novita-ai][Novita AI]] + - [[#xAI][xAI]] - [[#usage][Usage]] - [[#in-any-buffer][In any buffer:]] - [[#in-a-dedicated-chat-buffer][In a dedicated chat buffer:]] @@ -770,6 +772,43 @@ The above code makes the backend available to select. If you want it to be the #+html: +#+html:
+**** xAI +#+html: + +Register a backend with +#+begin_src emacs-lisp +;; xAI offers an OpenAI compatible API +(gptel-make-openai "xAI" ;Any name you want + :host "api.x.ai" + :key "your-api-key" ;can be a function that returns the key + :endpoint "/v1/chat/completions" + :stream t + :models '(;; xAI now only offers `grok-beta` as of the time of this writing + grok-beta)) +#+end_src + +You can pick this backend from the menu when using gptel (see [[#usage][Usage]]) + +***** (Optional) Set as the default gptel backend + +The above code makes the backend available to select. If you want it to be the default backend for gptel, you can set this as the value of =gptel-backend=. Use this instead of the above. +#+begin_src emacs-lisp +;; OPTIONAL configuration +(setq + gptel-model 'grok-beta + gptel-backend + (gptel-make-openai "xAI" ;Any name you want + :host "api.x.ai" + :key "your-api-key" ;can be a function that returns the key + :endpoint "/v1/chat/completions" + :stream t + :models '(;; xAI now only offers `grok-beta` as of the time of this writing + grok-beta))) +#+end_src + +#+html:
+ ** Usage (There is also a [[https://www.youtube.com/watch?v=bsRnh_brggM][video demo]] showing various uses of gptel.)