agentsclimarketplace

Openrouter embeddings

Skill QinghongLin/data2story-skill/skills/data2story-pro/designer/scripts/openrouter-embeddings

Data Journalist Agent: Transforming Data into Verifiable Multimodal Story

Install
npx -y skills add QinghongLin/data2story-skill --skill openrouter-embeddings

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Generate text embeddings via OpenRouter using Qwen3-Embedding-8B.

SKILL.md

2.0 KB, as published. Nobody here has run it

openrouter-embeddings

Text → embedding vector via OpenRouter. Default model: qwen/qwen3-embedding-8b.

Usage

Resolve TOOL_DIR = the directory containing this SKILL.md. Commands below use TOOL_DIR as a symbolic placeholder; replace it with the resolved, quoted path before running Bash.

Single text

export OPENROUTER_API_KEY=sk-or-v1-...

python3 TOOL_DIR/scripts/embed.py \
  --text "The quick brown fox jumps over the lazy dog" \
  --output vec.json

Batch from JSONL

Input records.jsonl (one JSON per line):

{"id": "row_0", "text": "Every place name in the United States."}
{"id": "row_1", "text": "Nearby stars and potential exoplanets."}

Run:

python3 TOOL_DIR/scripts/embed.py \
  --jsonl records.jsonl \
  --output records_with_embeddings.jsonl \
  --batch-size 32

Output is the same JSONL with an added embedding field per line.

Flags

FlagDefaultDescription
--textEmbed one string (mutually exclusive with --jsonl)
--jsonlEmbed many; each line must have a text field
--outputrequiredOutput path
--modelqwen/qwen3-embedding-8bAny embedding model on OpenRouter
--batch-size32Records per API call (jsonl mode)
--dimensionsOptional: truncate to N dims if supported

Endpoint

POST /api/v1/embeddings — OpenAI-compatible schema.

Request:

{ "model": "qwen/qwen3-embedding-8b", "input": ["text1", "text2", ...] }

Response:

{ "data": [ { "embedding": [0.01, -0.02, ...], "index": 0 }, ... ], "model": "...", "usage": {...} }

Notes

  • qwen3-embedding-8b outputs high-dimensional dense vectors suitable for semantic similarity, clustering, RAG.
  • For cheaper batches, consider qwen/qwen3-embedding-4b or other listed embedding models (GET /api/v1/embeddings/models).

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.