@f5-sales-demo/pi-ai 20.19.1 → 20.19.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 +34 -45
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -46,8 +46,7 @@ Unified LLM API with automatic model discovery, provider configuration, token an
|
|
|
46
46
|
|
|
47
47
|
## Supported Providers
|
|
48
48
|
|
|
49
|
-
- **OpenAI**
|
|
50
|
-
- **OpenAI Codex** (ChatGPT Plus/Pro subscription, requires OAuth, see below)
|
|
49
|
+
- **OpenAI** (usage-based Platform API access)
|
|
51
50
|
- **Anthropic**
|
|
52
51
|
- **Google**
|
|
53
52
|
- **Vertex AI** (Gemini via Vertex AI)
|
|
@@ -907,35 +906,35 @@ const response = await complete(
|
|
|
907
906
|
|
|
908
907
|
In Node.js environments, you can set environment variables to avoid passing API keys:
|
|
909
908
|
|
|
910
|
-
| Provider
|
|
911
|
-
|
|
|
912
|
-
| OpenAI
|
|
913
|
-
| Anthropic
|
|
914
|
-
| Google
|
|
915
|
-
| Vertex AI
|
|
916
|
-
| Mistral
|
|
917
|
-
| Groq
|
|
918
|
-
| Cerebras
|
|
919
|
-
| Together
|
|
920
|
-
| Qianfan
|
|
921
|
-
| Hugging Face
|
|
922
|
-
| Synthetic
|
|
923
|
-
| NVIDIA
|
|
924
|
-
| NanoGPT
|
|
925
|
-
| Venice
|
|
926
|
-
| Moonshot
|
|
927
|
-
| xAI
|
|
928
|
-
| OpenRouter
|
|
929
|
-
| LiteLLM
|
|
930
|
-
| Ollama
|
|
931
|
-
| Qwen Portal
|
|
932
|
-
| zAI
|
|
933
|
-
| MiniMax Code
|
|
934
|
-
| Xiaomi MiMo
|
|
935
|
-
| ZenMux
|
|
936
|
-
| vLLM
|
|
937
|
-
| Cloudflare AI Gateway | `CLOUDFLARE_AI_GATEWAY_API_KEY`
|
|
938
|
-
| GitHub Copilot
|
|
909
|
+
| Provider | Environment Variable(s) |
|
|
910
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
911
|
+
| OpenAI | `OPENAI_API_KEY` |
|
|
912
|
+
| Anthropic | `ANTHROPIC_API_KEY` or `ANTHROPIC_OAUTH_TOKEN` (or `ANTHROPIC_FOUNDRY_API_KEY` when `CLAUDE_CODE_USE_FOUNDRY=true`) |
|
|
913
|
+
| Google | `GEMINI_API_KEY` |
|
|
914
|
+
| Vertex AI | `GOOGLE_CLOUD_PROJECT` (or `GCLOUD_PROJECT`) + `GOOGLE_CLOUD_LOCATION` + ADC |
|
|
915
|
+
| Mistral | `MISTRAL_API_KEY` |
|
|
916
|
+
| Groq | `GROQ_API_KEY` |
|
|
917
|
+
| Cerebras | `CEREBRAS_API_KEY` |
|
|
918
|
+
| Together | `TOGETHER_API_KEY` |
|
|
919
|
+
| Qianfan | `QIANFAN_API_KEY` |
|
|
920
|
+
| Hugging Face | `HUGGINGFACE_HUB_TOKEN` or `HF_TOKEN` |
|
|
921
|
+
| Synthetic | `SYNTHETIC_API_KEY` |
|
|
922
|
+
| NVIDIA | `NVIDIA_API_KEY` |
|
|
923
|
+
| NanoGPT | `NANO_GPT_API_KEY` |
|
|
924
|
+
| Venice | `VENICE_API_KEY` |
|
|
925
|
+
| Moonshot | `MOONSHOT_API_KEY` |
|
|
926
|
+
| xAI | `XAI_API_KEY` |
|
|
927
|
+
| OpenRouter | `OPENROUTER_API_KEY` |
|
|
928
|
+
| LiteLLM | `LITELLM_API_KEY` |
|
|
929
|
+
| Ollama | `OLLAMA_API_KEY` (optional for local deployments) |
|
|
930
|
+
| Qwen Portal | `QWEN_OAUTH_TOKEN` or `QWEN_PORTAL_API_KEY` |
|
|
931
|
+
| zAI | `ZAI_API_KEY` |
|
|
932
|
+
| MiniMax Code | `MINIMAX_CODE_API_KEY` (international) or `MINIMAX_CODE_CN_API_KEY` (China) |
|
|
933
|
+
| Xiaomi MiMo | `XIAOMI_API_KEY` |
|
|
934
|
+
| ZenMux | `ZENMUX_API_KEY` |
|
|
935
|
+
| vLLM | `VLLM_API_KEY` |
|
|
936
|
+
| Cloudflare AI Gateway | `CLOUDFLARE_AI_GATEWAY_API_KEY` |
|
|
937
|
+
| GitHub Copilot | `COPILOT_GITHUB_TOKEN` or `GH_TOKEN` or `GITHUB_TOKEN` |
|
|
939
938
|
|
|
940
939
|
For Cloudflare AI Gateway models, use provider base URL format
|
|
941
940
|
`https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/anthropic`.
|
|
@@ -988,7 +987,6 @@ const key = getEnvApiKey("openai"); // checks OPENAI_API_KEY
|
|
|
988
987
|
Several providers support OAuth authentication (some also support static API keys):
|
|
989
988
|
|
|
990
989
|
- **Anthropic** (Claude Pro/Max subscription)
|
|
991
|
-
- **OpenAI Codex** (ChatGPT Plus/Pro subscription, access to GPT-5.x Codex models)
|
|
992
990
|
- **GitHub Copilot** (Copilot subscription)
|
|
993
991
|
- **Google Gemini CLI** (Gemini 2.0/2.5 via Google Cloud Code Assist; free tier or paid subscription)
|
|
994
992
|
- **Antigravity** (Free Gemini 3, Claude, GPT-OSS via Google Cloud)
|
|
@@ -1047,7 +1045,8 @@ bunx @f5-sales-demo/pi-ai list # list available providers
|
|
|
1047
1045
|
|
|
1048
1046
|
Credentials are saved to `agent.db` in the agent directory. `/login qianfan` opens the Qianfan console and stores the pasted API key.
|
|
1049
1047
|
|
|
1050
|
-
`login` supports OAuth providers (Anthropic,
|
|
1048
|
+
`login` supports OAuth providers (Anthropic, GitHub Copilot, Gemini CLI, Antigravity) and API-key onboarding flows.
|
|
1049
|
+
OpenAI uses usage-based Platform API access through `OPENAI_API_KEY`. For ChatGPT subscription access, use the official Codex CLI and run `codex login`.
|
|
1051
1050
|
|
|
1052
1051
|
For the current OpenAI-compatible integrations, API-key onboarding covers Together, Moonshot, Qianfan, NVIDIA, NanoGPT, Hugging Face, Venice, Xiaomi, vLLM, LiteLLM, Cloudflare AI Gateway, and Qwen Portal. Ollama is typically local and unauthenticated; set `OLLAMA_API_KEY` only when your Ollama deployment enforces bearer auth.
|
|
1053
1052
|
|
|
@@ -1059,7 +1058,6 @@ The library provides login and token refresh functions. Credential storage is th
|
|
|
1059
1058
|
import {
|
|
1060
1059
|
// Login functions (return credentials, do not store)
|
|
1061
1060
|
loginAnthropic,
|
|
1062
|
-
loginOpenAICodex,
|
|
1063
1061
|
loginGitHubCopilot,
|
|
1064
1062
|
loginGeminiCli,
|
|
1065
1063
|
loginAntigravity,
|
|
@@ -1081,20 +1079,11 @@ import {
|
|
|
1081
1079
|
getOAuthApiKey, // (provider, credentialsMap) => { newCredentials, apiKey } | null
|
|
1082
1080
|
|
|
1083
1081
|
// Types
|
|
1084
|
-
type OAuthProvider,
|
|
1082
|
+
type OAuthProvider,
|
|
1085
1083
|
type OAuthCredentials,
|
|
1086
1084
|
} from "@f5-sales-demo/pi-ai";
|
|
1087
1085
|
```
|
|
1088
1086
|
|
|
1089
|
-
`loginOpenAICodex` accepts an optional `originator` value used in the OAuth flow:
|
|
1090
|
-
|
|
1091
|
-
```typescript
|
|
1092
|
-
await loginOpenAICodex({
|
|
1093
|
-
onAuth: ({ url }) => console.log(url),
|
|
1094
|
-
originator: "my-cli",
|
|
1095
|
-
});
|
|
1096
|
-
```
|
|
1097
|
-
|
|
1098
1087
|
### Login Flow Example
|
|
1099
1088
|
|
|
1100
1089
|
```typescript
|
|
@@ -1149,7 +1138,7 @@ const response = await complete(
|
|
|
1149
1138
|
|
|
1150
1139
|
### Provider Notes
|
|
1151
1140
|
|
|
1152
|
-
**OpenAI
|
|
1141
|
+
**OpenAI**: Set `OPENAI_API_KEY` for usage-based Platform API access. ChatGPT subscription access is available through the official Codex CLI, not this library.
|
|
1153
1142
|
|
|
1154
1143
|
**GitHub Copilot**: If you get "The requested model is not supported" error, enable the model manually in VS Code: open Copilot Chat, click the model selector, select the model (warning icon), and click "Enable".
|
|
1155
1144
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/pi-ai",
|
|
4
|
-
"version": "20.19.
|
|
4
|
+
"version": "20.19.2",
|
|
5
5
|
"description": "Unified LLM API with automatic model discovery and provider configuration",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@anthropic-ai/sdk": "^0.115",
|
|
47
47
|
"@aws-sdk/client-bedrock-runtime": "^3",
|
|
48
48
|
"@bufbuild/protobuf": "^2.11",
|
|
49
|
-
"@f5-sales-demo/pi-utils": "20.19.
|
|
49
|
+
"@f5-sales-demo/pi-utils": "20.19.2",
|
|
50
50
|
"@google/genai": "^2.15",
|
|
51
51
|
"@sinclair/typebox": "^0.34",
|
|
52
52
|
"@smithy/node-http-handler": "^4.4",
|