[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/gptel e994a443d3 262/273: README: add OpenRouter instructi
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/gptel e994a443d3 262/273: README: add OpenRouter instructions (#282) |
Date: |
Wed, 1 May 2024 10:02:49 -0400 (EDT) |
branch: elpa/gptel
commit e994a443d35a34082ad5d6d45dd92163b10635cd
Author: Bryan Larsen <bryan@larsen.st>
Commit: GitHub <noreply@github.com>
README: add OpenRouter instructions (#282)
README: Add instructions for using OpenRouter.
---
README.org | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/README.org b/README.org
index 659667d0c2..b250b2bf71 100644
--- a/README.org
+++ b/README.org
@@ -20,6 +20,7 @@ GPTel is a simple Large Language Model chat client for Emacs,
with support for m
| Perplexity | ✓ |
[[https://docs.perplexity.ai/docs/getting-started][API key]] |
| Anthropic (Claude) | ✓ | [[https://www.anthropic.com/api][API key]]
|
| Groq | ✓ | [[https://console.groq.com/keys][API key]]
|
+| OpenRouter | ✓ | [[https://openrouter.ai/keys][API key]]
|
*General usage*: ([[https://www.youtube.com/watch?v=bsRnh_brggM][YouTube
Demo]])
@@ -61,6 +62,7 @@ GPTel uses Curl if available, but falls back to url-retrieve
to work without ext
- [[#perplexity][Perplexity]]
- [[#anthropic-claude][Anthropic (Claude)]]
- [[#groq][Groq]]
+ - [[#openrouter][OpenRouter]]
- [[#usage][Usage]]
- [[#in-any-buffer][In any buffer:]]
- [[#in-a-dedicated-chat-buffer][In a dedicated chat buffer:]]
@@ -506,6 +508,54 @@ The above code makes the backend available to select. If
you want it to be the
#+html: </details>
+#+html: <details><summary>
+**** OpenRouter
+#+html: </summary>
+
+Register a backend with
+#+begin_src emacs-lisp
+;; OpenRouter offers an OpenAI compatible API
+(gptel-make-openai "OpenRouter" ;Any name you want
+ :host "openrouter.ai"
+ :endpoint "/api/v1/chat/completions"
+ :stream t
+ :key "your-api-key" ;can be a function that returns the key
+ :models '("openai/gpt-3.5-turbo"
+ "mistralai/mixtral-8x7b-instruct"
+ "meta-llama/codellama-34b-instruct"
+ "codellama/codellama-70b-instruct"
+ "google/palm-2-codechat-bison-32k"
+ "google/gemini-pro"))
+
+#+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 "mixtral-8x7b-32768"
+ gptel-backend
+ (gptel-make-openai "OpenRouter" ;Any name you want
+ :host "openrouter.ai"
+ :endpoint "/api/v1/chat/completions"
+ :stream t
+ :key "your-api-key" ;can be a function that returns
the key
+ :models '("openai/gpt-3.5-turbo"
+ "mistralai/mixtral-8x7b-instruct"
+ "meta-llama/codellama-34b-instruct"
+ "codellama/codellama-70b-instruct"
+ "google/palm-2-codechat-bison-32k"
+ "google/gemini-pro")))
+
+#+end_src
+
+#+html: </details>
+
+
+
** Usage
(This is also a [[https://www.youtube.com/watch?v=bsRnh_brggM][video demo]]
showing various uses of gptel.)
- [nongnu] elpa/gptel 9925dc91b4 223/273: gptel: Improve markdown converter, (continued)
- [nongnu] elpa/gptel 9925dc91b4 223/273: gptel: Improve markdown converter, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel dade9ec8e1 231/273: gptel: Add introspection commands, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 7e6b106516 233/273: gptel-transient: Change menu display, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 26326c302e 249/273: gptel-anthropic: Parsing fix, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 22f7043c32 242/273: gptel: Fix gptel-end-of-response, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 94b13e78ec 239/273: gptel-transient: enable additional directive by default, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f24ec164cd 251/273: gptel: Adjust doc-string, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 5d74ec4de0 254/273: gptel: Set system message correctly in gptel-request, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 53ee34653e 252/273: gptel-openai: Typo in gptel--json-read, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel f2fd2b13b0 257/273: gptel-org: Move response transform code for Org, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel e994a443d3 262/273: README: add OpenRouter instructions (#282),
ELPA Syncer <=
- [nongnu] elpa/gptel 7b6e3c5900 260/273: gptel: Release v0.8.5, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4d4b61af94 259/273: gptel-transient: More robust dry-run commands, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 70889ad95c 263/273: gptel-gemini: Add Gemini 1.5 (#284), ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 4273f067e8 271/273: gptel-org: Improve stream converter, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c319966997 272/273: gptel-org: Further improve stream converter, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 040baad910 034/273: gptel: Remove aio dependency, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 1828dd3fa4 050/273: gptel: Set "waiting" state after sending the prompt, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel c9795fe9e8 060/273: gptel: org support for streaming WIP, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 644fc1de2f 118/273: gptel-transient: Handle empty input when setting temperature, ELPA Syncer, 2024/05/01
- [nongnu] elpa/gptel 3c01477c37 129/273: gptel: api-key shenanigans, ELPA Syncer, 2024/05/01