Skip to content

vgi-llm v0.1.0

Choose a tag to compare

@rustyconover rustyconover released this 13 Jul 20:05
· 8 commits to main since this release

vgi-llm brings Snowflake Cortex AISQL-style AI functions to DuckDB — call LLMs and embed text directly in SQL — over a pluggable provider (Anthropic / OpenRouter / OpenAI / local Ollama) plus keyless local ONNX embeddings.

Highlights

  • 14 functions: ai_complete (+_details/_image vision), ai_classify, ai_filter (BOOLEAN for WHERE), ai_extract, ai_sentiment, ai_summarize, ai_count_tokens (tiktoken), prompt (safe substitution), ai_embed / ai_similarity (keyless, fastembed/ONNX), and ai_agg / ai_summarize_agg (hierarchical chunked map-reduce).
  • Keyless to start — embeddings, similarity, prompt, and token counting need no key; one OpenRouter key unlocks hundreds of cloud models; local Ollama gives keyless completions.
  • Model auto-routing by prefix; keys via a unified llm DuckDB secret or env vars; six llm_* session settings (max_tokens/temperature/top_p/model/max_workers/timeout).
  • Loud failures — provider/runtime errors raise a DuckDB error; only empty input maps to NULL.

Install

INSTALL vgi FROM community; LOAD vgi;
ATTACH 'llm' (TYPE vgi, LOCATION 'uv run vgi-llm-worker');   -- from a source checkout

Or install the attached wheel (pip install vgi_llm-0.1.0-py3-none-any.whl) and use LOCATION 'vgi-llm-worker'. See the README.

Status

Solid beta. Calls paid provider APIs (cost is per-row); not yet security-hardened for untrusted input. CI green (ruff/mypy --strict/pytest × Python 3.13–3.14 on Linux+macOS, haybarn SQLLogic E2E, vgi-lint 100/100). MIT — Copyright 2026 Query Farm LLC.