
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
gemini_cli_oai_proxy
Advanced tools
通过 **OpenAI 兼容的 API** 提供 **Google Gemini 1.5 Pro** (或 Flash) 服务。 与已经支持 OpenAI 的客户端即插即用,例如 SillyTavern、llama.cpp、LangChain、VS Code 的 *Cline* 扩展等。
通过 OpenAI 兼容的 API 提供 Google Gemini 1.5 Pro (或 Flash) 服务。
与已经支持 OpenAI 的客户端即插即用,例如 SillyTavern、llama.cpp、LangChain、VS Code 的 Cline 扩展等。
✔ | 功能 | 备注 |
---|---|---|
/v1/chat/completions | 非流式 & 流式 (SSE) | 支持 curl、ST、LangChain… |
视觉支持 | image_url → Gemini inlineData | |
函数 / 工具调用 | OpenAI “functions” → Gemini 工具注册表 | |
推理 / 思维链 | 发送 enable_thoughts:true ,流式传输 <think> 区块 | ST 显示灰色气泡 |
100万 token 上下文 | 代理自动解除 Gemini CLI 默认的 20万 上限 | |
CORS | 默认启用 (* ) | 可用于浏览器应用 |
无外部依赖 | 仅需 Node 22 + TypeScript | 无 Express |
git clone https://huggingface.co/engineofperplexity/gemini-openai-proxy
cd gemini-openai-proxy
npm ci # 安装依赖 & ts-node
# 在 11434 端口启动
npx ts-node src/server.ts
PORT=3000
更改监听端口GEMINI_API_KEY=<key>
使用你自己的密钥curl -X POST http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-1.5-pro-latest",
"messages":[{"role":"user","content":"Hello Gemini!"}]
}'
字段 | 值 |
---|---|
API 基础 URL | http://127.0.0.1:11434/v1 |
模型 | gemini-1.5-pro-latest |
流式传输 | 开 |
推理 | 开 → 出现灰色 <think> 行 |
# 构建一次
docker build -t gemini-openai-proxy .
# 运行
docker run -p 11434:11434 \
-e GEMINI_API_KEY=$GEMINI_API_KEY \
gemini-openai-proxy
src/
server.ts – 极简 HTTP 服务器
mapper.ts – OpenAI ⇄ Gemini 转换
chatwrapper.ts – @google/genai 的轻量级封装
remoteimage.ts – 用于视觉的 fetch + base64
package.json – 依赖 & 脚本
Dockerfile
README.md
MIT – 个人和商业用途免费。
FAQs
通过 **OpenAI 兼容的 API** 提供 **Google Gemini 1.5 Pro** (或 Flash) 服务。 与已经支持 OpenAI 的客户端即插即用,例如 SillyTavern、llama.cpp、LangChain、VS Code 的 *Cline* 扩展等。
The npm package gemini_cli_oai_proxy receives a total of 101 weekly downloads. As such, gemini_cli_oai_proxy popularity was classified as not popular.
We found that gemini_cli_oai_proxy demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.