pi-requesty-discover 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -0
- package/package.json +4 -2
package/README.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# pi-requesty-discover
|
|
2
|
+
|
|
3
|
+
This extension helps you discover currently available models in requesty.ai for your Pi Coding Agent.
|
|
4
|
+
|
|
5
|
+
This is a fork of [pi-requesty](https://github.com/requestyai/pi-requesty) with additional features:
|
|
6
|
+
|
|
7
|
+
* Use `REQUESTY_API_KEY` from the environment
|
|
8
|
+
* Health-check available models and write a log about them
|
|
9
|
+
* Provide a dry-run mode that does not change anything
|
|
10
|
+
|
|
11
|
+
## When and why use it
|
|
12
|
+
|
|
13
|
+
Use this extension if
|
|
14
|
+
|
|
15
|
+
* you are on Requesty.ai
|
|
16
|
+
* you are limited to certain models by a company policy (for instance, for data residency/protection reasons)
|
|
17
|
+
* you don’t want to handcraft your own curated list of models constantly
|
|
18
|
+
* you want to health check the list to complain about non-working models via a dry-run
|
|
19
|
+
|
|
20
|
+
## Recommended Installation from GitHub repo
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pi install git:github.com/enolive/pi-requesty-discover
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Install locally
|
|
27
|
+
|
|
28
|
+
Check out the code from the official code repository `https://github.com/enolive/pi-requesty-discover`, and then:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pi install ./pi-requesty-discover
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
To run once without installing:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pi -e ./pi-requesty-discover
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
|
|
42
|
+
The extension reads the `requesty-export` provider from `~/.pi/agent/models.json`.
|
|
43
|
+
You can override the provider id with the `REQUESTY_PROVIDER_ID` variable.
|
|
44
|
+
|
|
45
|
+
Example:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"providers": {
|
|
50
|
+
"requesty-export": {
|
|
51
|
+
"name": "Requesty",
|
|
52
|
+
"baseUrl": "https://router.requesty.ai/v1",
|
|
53
|
+
"apiKey": "rqsty-sk-...",
|
|
54
|
+
"api": "openai-completions",
|
|
55
|
+
"models": []
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**❗ IMPORTANT**\
|
|
62
|
+
The `apiKey` from `models.json` is not used by this extension.
|
|
63
|
+
It may contain Pi-specific environment-variable substitution that the extension cannot reliably resolve.
|
|
64
|
+
Set `REQUESTY_API_KEY` instead. This variable is required.
|
|
65
|
+
|
|
66
|
+
**❗ IMPORTANT**\
|
|
67
|
+
Health checks are designed to use only a few tokens, but they still make real Requesty API calls and may consume credits.
|
|
68
|
+
|
|
69
|
+
On startup, the extension fetches `<baseUrl>/models` using `REQUESTY_API_KEY` as the bearer token and registers discovered and healthy models with Pi.
|
|
70
|
+
|
|
71
|
+
### Environment variables
|
|
72
|
+
|
|
73
|
+
| Name | Required | Type | Default | Meaning |
|
|
74
|
+
| --- | --- | --- | --- | --- |
|
|
75
|
+
| `REQUESTY_API_KEY` | yes | `string` | | Requesty API key used for model discovery and health checks. |
|
|
76
|
+
| `REQUESTY_PROVIDER_ID` | no | `string` | `requesty-export` | The id of the provider. |
|
|
77
|
+
| `REQUESTY_HEALTH_CHECK_MODE` | no | `off`, `basic`, `full` | `full` | The health-check mode. |
|
|
78
|
+
| `PI_CODING_AGENT_DIR` | no | `string` | `~/.pi/agent` | pi configuration directory |
|
|
79
|
+
|
|
80
|
+
## Command
|
|
81
|
+
|
|
82
|
+
Inside Pi:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
/requesty-discover
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The command fetches Requesty models using `~/.pi/agent/models.json` and writes the discovered model IDs back to the same file.
|
|
89
|
+
Run `/reload` after syncing.
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
/requesty-discover --dry-run
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This will not overwrite the `models.json` file, but will do everything else, including the health checks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-requesty-discover",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Discover available Requesty models for the Pi Coding Agent",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"test:unit": "vitest run src",
|
|
33
33
|
"test:unit:coverage": "vitest run src --coverage",
|
|
34
34
|
"test:integration": "vitest run test/integration.test.ts",
|
|
35
|
-
"test:watch": "vitest"
|
|
35
|
+
"test:watch": "vitest",
|
|
36
|
+
"prepack": "downdoc README.adoc"
|
|
36
37
|
},
|
|
37
38
|
"license": "MIT",
|
|
38
39
|
"peerDependencies": {
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
"@types/node": "^26.1.0",
|
|
49
50
|
"@vitest/coverage-v8": "^4.1.9",
|
|
50
51
|
"agnix": "^0.37.0",
|
|
52
|
+
"downdoc": "^1.1.0-stable",
|
|
51
53
|
"eslint": "^10.6.0",
|
|
52
54
|
"globals": "^17.7.0",
|
|
53
55
|
"jiti": "^2.7.0",
|