Skip to main content

Subquery

Subquery generates subqueries and follow-up questions for a given input question. Using the EXTREMELY SMOLL LLM subquery-SmolLM It's a finetuned model based on nisten/Biggie-SmoLlm-0.15B-Base

tiny as 150M (or 180M) parameters and thanks to wonderful work by Nisten and Huggingface's SmolLM-135M

It can run both with transformers and ollama backends. Ollama based GGUF model runs at 160 tps for 1 CPU.

yes.

It can do two things:

  1. Generate subqueries for a given question. q1
  2. Generate follow-up questions for a vague question. q2

This package wraps the model and provides a simple interface to generate subqueries and follow-up questions.

Installation

You can install the package with

pip install subquery

Usage

For Transformers

from subquery import TransformersSubqueryGenerator

# Using the Transformers backend
generator = TransformersSubqueryGenerator()
result = generator.generate("What is this?")

print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)

For Ollama

from subquery import OllamaSubqueryGenerator
# Using the Ollama backend
generator = OllamaSubqueryGenerator()
result = generator.generate("Are the Indiana Harbor and Ship Canal and the Folsom South Canal in the same state?")

print("Follow-up questions:", result.follow_up)
print("Subqueries:", result.subquery)

Metadata

Release files for subquery 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for subquery 0.1.2
File Size Uploaded
subquery-0.1.2.tar.gz 2.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for subquery 0.1.2
File Interpreter ABI Platform
subquery-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.2 kB

Release files / subquery-0.1.2.tar.gz

Download URL subquery-0.1.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b89fc5bb4e76003734be9eed1847a34a39edc35317af2a3cff548d820e9f54c
BLAKE2b-256 checksum
How to use checksums
1651af2aaf6b4754a1e173248206863f0bb63c739bde37940ea1e32ae2a10c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0

Release files / subquery-0.1.2-py3-none-any.whl

Download URL subquery-0.1.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa5145bdc89cf9b3f4a5d50809753bf2a118ca648f29362c4e9062f4de2f8d56
BLAKE2b-256 checksum
How to use checksums
7f61225501d59fc5b0816b6be2a8bb01ce7c10e821503387de627d6db6e55bd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.6 Darwin/23.3.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page