
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
@ragpipe/plugin-openai
Advanced tools
OpenAI embedding and generation plugin for ragpipe.
pnpm add ragpipe @ragpipe/plugin-openai
import { defineConfig } from "ragpipe";
import { openaiEmbedding, openaiGeneration } from "@ragpipe/plugin-openai";
export default defineConfig({
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY ?? "",
model: "text-embedding-3-small",
}),
generation: openaiGeneration({
apiKey: process.env.OPENAI_API_KEY ?? "",
model: "gpt-4o-mini",
systemPrompt: "Answer based on the provided context.",
}),
// ... vectorStore
});
openaiEmbedding(options)Returns an EmbeddingPlugin that calls the OpenAI Embeddings API.
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | OpenAI API key (required) |
model | string | "text-embedding-3-small" | Embedding model name |
dimensions | number | model default (1536 / 3072) | Output dimensions (text-embedding-3-* only) |
baseUrl | string | "https://api.openai.com/v1" | API base URL |
embedMany() sends array input in a single API calltext-embedding-3-small/large support custom dimensions to reduce output sizebaseUrl to use OpenRouter, Azure OpenAI, or other OpenAI-compatible endpointsopenaiGeneration(options)Returns a GenerationPlugin that calls the OpenAI Chat Completions API.
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | OpenAI API key (required) |
model | string | "gpt-4o-mini" | Chat model name |
systemPrompt | string | "Answer based on the provided context." | Default system instruction |
baseUrl | string | "https://api.openai.com/v1" | API base URL |
generateStream() returns an AsyncIterable<string> via SSE{ history } to include conversation context{ systemPrompt } at call time to override the defaultbaseUrl to use OpenRouter, Azure OpenAI, or other OpenAI-compatible endpoints| Model | Dimensions | Notes |
|---|---|---|
text-embedding-3-small | 1536 | Default, cost-efficient |
text-embedding-3-large | 3072 | High precision |
text-embedding-ada-002 | 1536 | Legacy |
| Model | Notes |
|---|---|
gpt-4o-mini | Default, cost-efficient |
gpt-4o | Flagship |
o1 | Reasoning |
o3-mini | Reasoning (lightweight) |
OPENAI_API_KEY in your environmentMIT
FAQs
OpenAI embedding and generation plugin for ragpipe
We found that @ragpipe/plugin-openai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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 mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.