opendcai/dataflow-webui/kcentergreedy-filter
Claude Code and agent skill by opendcai/dataflow-webui
- community
Checking that the SKILL.md file is still in the repository.
Reference documentation for the KCenterGreedyFilter operator. Covers the constructor, K-Center Greedy algorithm behavior, embedding serving requirements, and pipeline usage notes. Use when: downsampling a large dataset by semantic diversity using embedding vectors.
Install
npx vskill@latest install opendcai/dataflow-webui/kcentergreedy-filterSKILL.md
KCenterGreedyFilter Operator Reference
KCenterGreedyFilter uses the K-Center Greedy algorithm to select the most diverse num_samples rows, deleting all others.
1. Imports
2. Embedding Serving Options
Option A: Remote API with APILLMServing_request
Option B: Local embedding model with LocalEmbeddingServing
Option C: Provider-agnostic API via LiteLLMServing
Option D: Local vLLM backend with LocalModelLLMServing_vllm
Practical Serving Note
The operator calls embedding_serving.generate_embedding_from_input(texts). Any serving object implementing this method can be used.
Supported: APILLMServing_request, LocalEmbeddingServing, LiteLLMServing, LocalModelLLMServing_vllm
Not supported: LocalModelLLMServing_sglang (raises NotImplementedError)
3. Constructor
| Parameter | Required | Default | Description | |
|---|---|---|---|---|
num_samples | Yes | None | Number of rows to keep; must be ≤ total DataFrame row count. | |
embedding_serving | No | None | Embedding service object implementing generate_embedding_from_input(...). Must point to /v1/embeddings endpoint if using APILLMServing_request. |
Important Constructor Notes
- Parameter order: Source code signature is
__init__(self, num_samples, embedding_serving=None). num_samplesis the first positional parameter.embedding_servingis the second parameter with defaultNone.
Important Serving Note
The operator calls embedding_serving.generate_embedding_from_input(texts). The serving object must implement this method.
4. run() Signature
| Parameter | Required | Default | Description | |
|---|---|---|---|---|
storage | Yes | None | DataFlowStorage step object. | |
input_key | No | "content" | Text column to compute embeddings from; must already exist. |
Return Value
Returns [self.input_key] (a list). Pipeline forward() methods should not return values.
5. Actual Runtime Logic
The source code behavior is:
- Store
input_keyonself.input_key. - Read the DataFrame from
storage.read("dataframe"). - Validate that
input_keycolumn exists. - Extract text list:
texts = dataframe[input_key].tolist(). - Call
self.embedding_serving.generate_embedding_from_input(texts)to get embeddings. - Convert embeddings to torch tensor.
- Calculate
sampling_ratio = num_samples / len(texts). - Use
KCenterGreedyalgorithm to selectnum_samplesdiverse row indices. - Create a binary mask and keep only selected rows.
- Write the filtered DataFrame back via
storage.write(dataframe). - Return
[self.input_key].
Key Behavior Notes
num_samplesmust be ≤ the current DataFrame row count.embedding_servingmust implementgenerate_embedding_from_input(...).- For
APILLMServing_request,api_urlmust point to/v1/embeddings, not/v1/chat/completions. - Filtering is irreversible — unselected rows are permanently deleted.
6. Pipeline Usage Pattern
Note: forward() has no return value, following the standard pipeline pattern.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/canonical/core_text/filter/kcentergreedy-filter/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/opendcai/dataflow-webui/kcentergreedy-filter)