branch: elpa/gptel
commit 223b9ac6fb83e588abdaed8f7df7bbeaebd7d0a5
Author: Karthik Chikmagalur <karthikchikmaga...@gmail.com>
Commit: Karthik Chikmagalur <karthikchikmaga...@gmail.com>

    README: Add instructions for AWS Bedrock
---
 README.org | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/README.org b/README.org
index 54c6bab295..98713aafb7 100644
--- a/README.org
+++ b/README.org
@@ -34,6 +34,7 @@ gptel is a simple Large Language Model chat client for Emacs, 
with support for m
 | 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]]                    |
 | Github CopilotChat   | ✓        | Github account             |
+| Bedrock              | ✓        | AWS credentials            |
 #+html: </div>
 
 *General usage*: ([[https://www.youtube.com/watch?v=bsRnh_brggM][YouTube 
Demo]])
@@ -119,6 +120,7 @@ gptel uses Curl if available, but falls back to the 
built-in url-retrieve to wor
       - [[#novita-ai][Novita AI]]
       - [[#xai][xAI]]
       - [[#github-copilotchat][Github CopilotChat]]
+      - [[#aws-bedrock][AWS Bedrock]]
   - [[#usage][Usage]]
     - [[#in-any-buffer][In any buffer:]]
     - [[#in-a-dedicated-chat-buffer][In a dedicated chat buffer:]]
@@ -943,6 +945,47 @@ The above code makes the backend available to select.  If 
you want it to be the
 
 #+html: </details>
 
+#+html: <details><summary>
+**** AWS Bedrock
+#+html: </summary>
+
+Register a backend with
+#+begin_src emacs-lisp
+(gptel-make-bedrock "AWS"
+  :region "ap-northeast-1"
+  ;; subset of gptel--bedrock-models
+  :models '(claude-3-5-sonnet-20241022)
+  ;; optional for provisioned access
+  :model-region 'apac)
+#+end_src
+
+The Bedrock backend gets your AWS credentials from the environment variables. 
It expects to find either
+~AWS_ACCESS_KEY_ID~, ~AWS_SECRET_ACCESS_KEY~, ~AWS_SESSION_TOKEN~ (optional), 
or if present, can use ~AWS_PROFILE~ to get these directly from the ~aws~ cli.
+
+NOTE: The Bedrock backend needs curl >= 8.5 in order for the sigv4 signing to 
work properly,
+https://github.com/curl/curl/issues/11794
+
+An error will be signalled if ~gptel-curl~ is ~NIL~.
+
+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   'claude-3-5-sonnet-20241022
+      gptel-backend
+      (gptel-make-bedrock "AWS"
+       :region "ap-northeast-1"
+          ;; subset of gptel--bedrock-models
+          :models '(claude-3-5-sonnet-20241022)
+          ;; optional
+          :model-region 'apac))
+#+end_src
+
+#+html: </details>
+
 ** Usage
 
 gptel provides a few powerful, general purpose and flexible commands.  You can 
dynamically tweak their behavior to the needs of your task with /directives/, 
redirection options and more.  There is a 
[[https://www.youtube.com/watch?v=bsRnh_brggM][video demo]] showing various 
uses of gptel -- but =gptel-send= might be all you need.

Reply via email to