
Security News
npm ‘is’ Package Hijacked in Expanding Supply Chain Attack
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
A project combining VTK visualization with LLM APIs (Anthropic, OpenAI, NVIDIA NIM)
A command-line interface and web-based UI for generating VTK visualization code using Large Language Models (Anthropic Claude, OpenAI GPT, NVIDIA NIM, and local models).
pip install vtk-prompt
pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ vtk-prompt
git clone https://github.com/vicentebolea/vtk-prompt.git
cd vtk-prompt
pip install -e .
export ANTHROPIC_API_KEY="your-anthropic-key"
export OPENAI_API_KEY="your-openai-key" # Optional
vtk-prompt-ui
Access the UI at http://localhost:8080
# Generate VTK code
vtk-prompt "Create a red sphere"
# With RAG enhancement
vtk-prompt "Create a sphere with custom resolution" --rag
# Different providers
vtk-prompt "Create a blue cube" --provider openai
vtk-prompt "Create a cone" --provider nim --token YOUR_NIM_TOKEN
The web interface provides:
# Basic usage
vtk-prompt "Create a red sphere"
# Advanced options
vtk-prompt "Create a textured cone with 32 resolution" \
--provider anthropic \
--model claude-3-5-sonnet-20241022 \
--max-tokens 4000 \
--rag \
--verbose
# Using different providers
vtk-prompt "Create a blue cube" --provider openai --model gpt-4o
vtk-prompt "Create a cylinder" --provider nim --model meta/llama3-70b-instruct
Enhance code generation with relevant VTK examples:
vtk-build-rag
vtk-test-rag "How to create a cube in VTK"
vtk-prompt "Create a vtkSphereSource with texture mapping" --rag
from vtk_prompt import VTKPromptClient
client = VTKPromptClient()
code = client.generate_code("Create a red sphere")
print(code)
ANTHROPIC_API_KEY
- Anthropic Claude API keyOPENAI_API_KEY
- OpenAI API key (also used for NVIDIA NIM)Provider | Default Model | Base URL |
---|---|---|
anthropic | claude-3-5-haiku-20241022 | https://api.anthropic.com/v1 |
openai | gpt-4o | https://api.openai.com/v1 |
nim | meta/llama3-70b-instruct | https://integrate.api.nvidia.com/v1 |
custom | User-defined | User-defined (for local models) |
You can use local models via OpenAI-compatible APIs:
# Using Ollama
vtk-prompt "Create a sphere" \
--provider custom \
--base-url http://localhost:11434/v1 \
--model llama2
# Using LM Studio
vtk-prompt "Create a cube" \
--provider custom \
--base-url http://localhost:1234/v1 \
--model local-model
git clone https://github.com/vicentebolea/vtk-prompt.git
cd vtk-prompt
pip install -e ".[all]"
# Lint and format
black src/
flake8 src/
# Test installation
vtk-prompt --help
vtk-prompt-ui --help
python -m build
usage: vtk-prompt [-h] [--provider {anthropic,openai,nim,custom}]
[-m MODEL] [-k MAX_TOKENS] [-t TOKEN] [--base-url BASE_URL]
[-r] [-v] [--collection COLLECTION] [--database DATABASE]
[--top-k TOP_K] input_string
Generate VTK visualization code using Large Language Models
positional arguments:
input_string Description of the VTK visualization to generate
options:
-h, --help Show this help message and exit
-m MODEL, --model MODEL
Model name to use
-k MAX_TOKENS, --max-tokens MAX_TOKENS
Maximum number of tokens to generate
-t TOKEN, --token TOKEN
API token (defaults to environment variable)
--base-url BASE_URL Base URL for API (for custom/local models)
-r, --rag Use Retrieval Augmented Generation
-v, --verbose Show generated source code
--provider {anthropic,openai,nim,custom}
LLM provider to use
RAG Options:
--collection COLLECTION
Collection name for RAG (default: vtk-examples)
--database DATABASE Database path for RAG (default: ./db/codesage-codesage-large-v2)
--top-k TOP_K Number of examples to retrieve (default: 5)
vtk-prompt
- Main CLI for code generationvtk-prompt-ui
- Launch web interfacevtk-build-rag
- Build RAG database from VTK examplesvtk-test-rag
- Test RAG functionalitygen-vtk-file
- Generate VTK XML filesrag-chat
- Interactive RAG chat interfaceContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature
)git commit -m 'Add some amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Made with care for the VTK and scientific visualization community.
FAQs
A project combining VTK visualization with LLM APIs (Anthropic, OpenAI, NVIDIA NIM)
We found that vtk-prompt 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.
Security News
The ongoing npm phishing campaign escalates as attackers hijack the popular 'is' package, embedding malware in multiple versions.
Security News
A critical flaw in the popular npm form-data package could allow HTTP parameter pollution, affecting millions of projects until patched versions are adopted.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.