{"id":37976716,"url":"https://github.com/ibm/spnl","last_synced_at":"2026-02-19T15:05:00.734Z","repository":{"id":301389918,"uuid":"1009100024","full_name":"IBM/spnl","owner":"IBM","description":"Span Queries: What if we had a way to plan and optimize GenAI like we do for SQL?","archived":false,"fork":false,"pushed_at":"2026-01-20T18:54:35.000Z","size":10753,"stargazers_count":11,"open_issues_count":17,"forks_count":6,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-20T23:15:31.999Z","etag":null,"topics":["generative-ai","kvcache","locality","optimization","sql"],"latest_commit_sha":null,"homepage":"https://ibm.github.io/spnl/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IBM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-26T15:17:58.000Z","updated_at":"2026-01-20T18:54:39.000Z","dependencies_parsed_at":"2025-08-19T19:25:52.144Z","dependency_job_id":"b80f865b-1702-43db-8c1f-8930849b0acd","html_url":"https://github.com/IBM/spnl","commit_stats":null,"previous_names":["ibm/spnl"],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/IBM/spnl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2Fspnl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2Fspnl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2Fspnl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2Fspnl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IBM","download_url":"https://codeload.github.com/IBM/spnl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IBM%2Fspnl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28763077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T00:37:26.264Z","status":"ssl_error","status_checked_at":"2026-01-26T00:37:25.959Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["generative-ai","kvcache","locality","optimization","sql"],"created_at":"2026-01-16T18:31:12.527Z","updated_at":"2026-02-15T22:13:53.137Z","avatar_url":"https://github.com/IBM.png","language":"Rust","readme":"# Span Queries\n\n[![arXiv](https://img.shields.io/badge/arXiv-2511.02749-b31b1b.svg?style=flat)](https://arxiv.org/abs/2511.02749)\n[![Crates.io - Version](https://img.shields.io/crates/v/spnl)](https://crates.io/crates/spnl)\n[![PyPI - Version](https://img.shields.io/pypi/v/spnl)](https://pypi.org/project/spnl)\n[![CI - Core](https://github.com/IBM/spnl/actions/workflows/core.yml/badge.svg)](https://github.com/IBM/spnl/actions/workflows/core.yml)\n[![CI - Python](https://github.com/IBM/spnl/actions/workflows/python.yml/badge.svg)](https://github.com/IBM/spnl/actions/workflows/python.yml)\n![GitHub License](https://img.shields.io/github/license/IBM/spnl)\n\n\u003cimg align=\"right\" src=\"/docs/images/nested-gen.svg\" width=\"150\"\u003e\n\nUse of LLM-based inference is evolving from its origins of chat. These\ndays, use cases involve the combination of multiple inference calls,\ntool calls, and database\nlookups. [RAG](https://en.wikipedia.org/wiki/Retrieval-augmented_generation),\n[agentic AI](https://en.wikipedia.org/wiki/AI_agent), and [deep\nresearch](https://en.wikipedia.org/wiki/ChatGPT_Deep_Research) are\nthree examples of these more sophisticated use cases.\n\nThe goal of this project to facilitate optimizations that drastically\nreduce the cost of inference for RAG, agentics, and deep research (by\n10x [^1]) without harming accuracy. Our approach is to\ngeneralize the interface to inference servers via the **Span\nQuery**.\n\nIn a span query, chat is a special case of a more general\nform. To the right is a visualization of a span query for a\n\"judge/generator\" (a.k.a. \"LLM-as-a-judge\").\n\nLearn more about [span query syntax and semantics](./docs/about.md)\n\n[^1]: https://arxiv.org/html/2409.15355v5\n\n\n## Getting Started with SPNL\n\nSPNL is a library for creating, optimizing, and tokenizing span\nqueries. The library is surfaced for consumption as:\n\n[**vLLM image**](https://github.com/IBM/spnl/pkgs/container/spnl-llm-d-cuda) **|** [**vLLM patch**](docker/vllm/llm-d/patches/0.4.0) **|** [**CLI image**](https://github.com/IBM/spnl/pkgs/container/spnl) **|** [**CLI image\n  with  Ollama**](https://github.com/IBM/spnl/pkgs/container/spnl-ollama) **|** [**Rust crate**](https://crates.io/crates/spnl) **|** [**Python pip**](https://pypi.org/project/spnl)\n\n## Using the `spnl` CLI\n\nThe `spnl` CLI provides commands for running span queries and managing vLLM deployments. For macOS users, you can install via Homebrew:\n\n```bash\n# Add the tap\nbrew tap IBM/spnl https://github.com/IBM/spnl\n\n# Install the spnl CLI\nbrew install spnl\n```\n\nFor other platforms, you can download the latest `spnl` CLI from the [SPNL releases page](https://github.com/IBM/spnl/releases/latest).\n\n### Managing vLLM Deployments\n\nThe `spnl` CLI provides commands to easily deploy and manage vLLM inference servers on Kubernetes or Google Compute Engine. See the [vLLM documentation](./docs/vllm.md) for detailed instructions.\n\nQuick example:\n```shell\n# Bring up a vLLM server on Kubernetes (requires HuggingFace token)\nspnl vllm up my-deployment --target k8s --hf-token YOUR_HF_TOKEN\n\n# Bring down the vLLM server\nspnl vllm down my-deployment --target k8s\n```\n\n### Quick Start with Docker\n\nTo kick the tires with the `spnl` CLI running [Ollama](https://ollama.com/):\n```shell\npodman run --rm -it ghcr.io/ibm/spnl-ollama --verbose\n```\n\nThis will run a judge/generator email example. You also can point it\nto a JSON file containing a [span query](./docs/about).\n\n### CLI Usage\n\nFor comprehensive CLI documentation including all commands, options, and examples, see [docs/cli.md](./docs/cli.md).\n\nQuick reference:\n```bash\n# Run a query\nspnl run [OPTIONS]\n\n# Run with timing metrics (reports TTFT and ITL to stderr)\nspnl run --time [OPTIONS]\n\n# List available local models (requires 'local' feature)\nspnl list\n\n# Run with a local model using pretty names\nspnl run --builtin email2 --model llama3.2:1b\n\n# Manage vLLM deployments\nspnl vllm \u003cup|down\u003e [OPTIONS]\n\n# Get help\nspnl --help\nspnl run --help\nspnl vllm --help\n```\n\n## Building SPNL\n\nFirst, [configure your\nenvironment](./https://www.rust-lang.org/tools/install) for Rust.  Now\nyou can build the CLI with `cargo build -p spnl-cli`, which will\nproduce `./target/debug/spnl`. Adding `--release` will produce a build\nwith source code optimizations in `./target/release/spnl`.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm%2Fspnl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fibm%2Fspnl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fibm%2Fspnl/lists"}