fsdatalab/quail
fsdatalab/quail has 187 GitHub stars and 19 forks. Star changes are not measured yet. Last checked 2026-11-11 08:07 UTC. Last push 2026-11-11.
An open-source inference engine for AI functions in SQL
实测星标增长
- 24小时
- 更新延迟
- 7天
- 更新延迟
- 15天
- 更新延迟
- 1个月
- 更新延迟
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Quail
An open-source inference engine for AI functions in SQL
from the Full Stack Data Lab at CMU
Quail (QUery-Aware Inference Layer) runs LLMs over large datasets, from SQL, on your own GPUs. Quail's secret sauce is to optimize LLM inference and memory management for each query as a whole. This makes Quail lightning fast: 1.8x faster on average than well-tuned vLLM baselines, and up to 14x faster on queries with AI joins (details)!
SELECT r.id,
AI.EXTRACT(r.body, {'actor': 'Which actor does the reviewer name?'}) AS review
FROM reviews r
WHERE AI.IF(PROMPT('Does this review discuss the ending?\n\n{0}', r.body))
Documentation | Quickstart | Blog | QUAIL-B
Install
Install quail-engine from PyPI.
In Python, import quail.
uv pip install quail-engine
You need Python 3.12 and a CUDA GPU.
Example
import pyarrow as pa
import quail
reviews = pa.table({
"id": ["r1", "r2", "r3"],
"body": [
"A beautiful film with outstanding performances.",
"Terrible pacing and a nonsensical plot.",
"The cinematography was stunning, though the story dragged.",
],
})
config = quail.EngineConfig(model="qwen3-4b-fp8", device="h100-sxm")
with quail.Session(config=config) as session:
session.register("reviews", quail.DocumentProvider.from_table(reviews, id_col="id"))
result = session.sql("""
SELECT r.id
FROM reviews r
WHERE AI.IF(PROMPT(
'Does this review mention a positive aspect of the movie?\n\n{0}',
r.body))
""", dialect="bq").collect()
print(result)
Quail Server
You can use Quail Server to run queries on the machine with your GPU.
Start the HTTP server and set endpoint to its address. Your queries
continue if you disconnect. submit() returns after the server saves
your query. Use get_run(query_id) to reconnect later.
uv pip install "quail-engine[server]"
quail-server
import pyarrow as pa
import quail
reviews = pa.table({
"id": ["r1", "r2"],
"body": ["The ending was excellent.", "I liked the soundtrack."],
})
sql = """
SELECT r.id
FROM reviews r
WHERE AI.IF(PROMPT('Does this discuss the ending? {0}', r.body))
"""
config = quail.EngineConfig(model="qwen3-4b-fp8", device="h100-sxm")
with quail.Session(
config=config,
endpoint="http://127.0.0.1:8642",
) as session:
session.register(
"reviews",
quail.DocumentProvider.from_table(reviews, id_col="id"),
)
run = session.sql(sql, dialect="bq").submit()
for status in run.watch():
print(status.phase["message"])
table = run.result().collect()
print(table)
See Quail Server.
Supported functions
You can use filters and joins evaluated by a language model,
EXISTS / NOT EXISTS, numeric scores (AI.SCORE), classification
(AI.CLASSIFY), extracting text that answers a question (AI.EXTRACT),
and writing a text answer for each document (AI.MAP).
You can write queries in two SQL dialects for AI functions:
Snowflake AI_FILTER
and
BigQuery AI.IF.
Supported models and GPUs
Quail runs Qwen3, Qwen3.5, Qwen3.6, Qwen3.8, LFM2, d1, DiffusionGemma, and Decision 2.0 Kai models on NVIDIA H100 SXM, B200, L40S, and RTX PRO 6000 Blackwell GPUs, with 1, 2, 4, or 8 GPUs per query. See Supported models and GPUs for each model's AI functions and GPU limits.
Development
uv run ruff check quail bench calibrate tests experiments tools
uv run python tools/check_long_strings.py
uv run python tools/check_names.py
uv run vulture
uv run lint-imports
uv run pytest -q
Contributing
See the contributing guide for how to propose and submit changes.
探索相关项目
Asabeneh/30-Days-Of-Python
30 Days of Python 编程挑战是一份循序渐进的指南,用于在 30 天内学习 Python 编程语言。这项挑战可能需要超过 100 天。请按自己的节奏进行。这些视频或许也有帮助:https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,560 星标grafana/grafana
开放且可组合的可观测性与数据可视化平台。可对来自 Prometheus、Loki、Elasticsearch、InfluxDB、Postgres 等众多数据源的指标、日志和追踪进行可视化。
77,830 星标redis/redis
对于正在构建实时数据驱动应用的开发者而言,Redis 是首选、速度最快且功能最丰富的缓存、数据结构服务器和文档与向量查询引擎。
77,395 星标apache/superset
Apache Superset 是一个数据可视化与数据探索平台
75,473 星标