# Kwker > Kwker makes data and AI work faster on the CPUs you already run - PyTorch models, language models, text embeddings, image models, > DataFrames, DuckDB, NumPy and sorting - with the same results. Every documentation page below is plain Markdown (https://kwker.io/docs/md/.md); all of them in one file: https://kwker.io/llms-full.txt. The same pages for people: https://kwker.io/docs/?p=. ## Get started - [Kwker documentation](https://kwker.io/docs/md/index.md): Kwker makes CPU work quicker - PyTorch models, LLM text generation, embeddings, DataFrames and sorting - from Python, Rust, C, C++ and 16 more languages. - [Add Kwker to your project](https://kwker.io/docs/md/integrate.md): Add Kwker to code you already run, one change per workload: PyTorch models, language models, embeddings, image models, DataFrames and sorting. - [Coming from another library](https://kwker.io/docs/md/coming-from.md): The Kwker call for each sort, partition, top-k and search call you already use - NumPy, PyTorch, the C++ and Rust standard libraries, Java, JavaScript, Go and .NET. - [Evaluate Kwker on your machine](https://kwker.io/docs/md/evaluate.md): Measure Kwker on your own hardware and your own code before you adopt it - a machine report, a benchmark against your libraries and a side-by-side run of your program. - [Quickstarts](https://kwker.io/docs/md/quickstart.md): Pick your workflow and get Kwker running on it in minutes - PyTorch, language models, embeddings, image models, DataFrames, DuckDB, NumPy or Core. - [Quickstart: PyTorch](https://kwker.io/docs/md/quickstart-pytorch.md): Speed up a PyTorch model on the CPU without changing its code - kwker.torch_ops.install() or torch.compile(backend="kwker") - and check that the results stay the same. - [Quickstart: language models](https://kwker.io/docs/md/quickstart-llm.md): Generate text with a Hugging Face language model on the CPU with KwkDecoder, keep model.generate() with install(), or serve an OpenAI-compatible API. - [Quickstart: embeddings](https://kwker.io/docs/md/quickstart-embeddings.md): Compute text embeddings and reranker scores faster on the CPU with KwkEncoder - BERT, RoBERTa, XLM-R, MPNet, ModernBERT, NomicBERT, EuroBERT and their embedders. - [Quickstart: image models](https://kwker.io/docs/md/quickstart-vision.md): Classify images faster on the CPU with KwkCNN - ResNet, MobileNet, EfficientNet and similar models - in float32 or calibrated int8. - [Quickstart: DataFrames](https://kwker.io/docs/md/quickstart-dataframes.md): Group, sort and take the top rows of pandas, Polars and pyarrow tables faster with kwker.frame - you get back the same table type, with the same results. - [Quickstart: DuckDB](https://kwker.io/docs/md/quickstart-duckdb.md): Run ORDER BY ... LIMIT, sorts and GROUP BY on DuckDB results faster with kwker.duck - a DuckDB relation in, a DuckDB relation (or a pyarrow Table) out. - [Quickstart: NumPy](https://kwker.io/docs/md/quickstart-numpy.md): Make an existing NumPy program's sort, argsort, unique and searchsorted calls run on Kwker with one line, and get NumPy's exact results. - [Quickstart: Kwker Core](https://kwker.io/docs/md/quickstart-core.md): Sort, select and rank arrays with Kwker Core in Python, Rust, C, C++, JavaScript, Go, Java or C#, every example runnable in your browser. - [Installation](https://kwker.io/docs/md/install.md): Install Kwker for Python, Rust, C and C++, verify the download, and build it from source on Linux, macOS and Windows. - [Deploy and operate](https://kwker.io/docs/md/deploy.md): Run Kwker in production - containers, mixed machines, offline installs, memory limits, the files it writes and what it never does (network, telemetry, license checks). ## Tutorials - [Tutorials](https://kwker.io/docs/md/tutorials.md): Tutorials by workflow - accelerate PyTorch, Hugging Face models, image models, JAX and data work - each a short path from your code to a measured speed-up. - [Accelerate PyTorch](https://kwker.io/docs/md/pytorch.md): Speed up PyTorch on the CPU with Kwker - pick your workflow - inference, torch.compile, lower precision, training, whole-model runners or operators. - [Speed up PyTorch inference](https://kwker.io/docs/md/pytorch-inference.md): Make an existing PyTorch model faster on the CPU with one line, check that its results stay the same, and measure the gain on your machine. - [Compile with torch.compile](https://kwker.io/docs/md/pytorch-compile.md): Compile a PyTorch model for the CPU with torch.compile(backend="kwker") - what it changes, its options, and how to keep compile times short. - [Lower precision with an accuracy check](https://kwker.io/docs/md/pytorch-precision.md): Run PyTorch linear layers, attention and convolutions in bfloat16 or int8 on AMX and VNNI CPUs, after measuring the accuracy on your own model. - [Train faster on the CPU](https://kwker.io/docs/md/pytorch-training.md): Train PyTorch models faster on the CPU - fused Adam, AdamW and SGD steps, faster data transforms and embedding gradients - with the same parameters bit for bit. - [Sorting operators and layers](https://kwker.io/docs/md/pytorch-operators.md): Call Kwker's PyTorch operators directly - sort, top-k, median pooling, k-winners-take-all - with autograd, vmap, torch.compile and torch.export. - [Tutorial: speed up a PyTorch model](https://kwker.io/docs/md/tutorial-pytorch.md): Speed up a PyTorch model on the CPU in three steps - drop-in kernels, the torch.compile backend, then a timing on your own machine - checking results at each step. - [Accelerate Hugging Face](https://kwker.io/docs/md/hf.md): Run Hugging Face models faster on the CPU with Kwker - generate text, chat, serve an OpenAI-compatible API, quantize, and embed sentences. - [Generate text with a Hugging Face model](https://kwker.io/docs/md/hf-generate.md): Generate text with a Hugging Face language model on the CPU through KwkDecoder - check support, generate, sample, and keep model.generate() unchanged. - [int8 and int4 weights](https://kwker.io/docs/md/hf-quantize.md): Shrink a Hugging Face language model to int8 or int4 weights with KwkDecoder, keep the packed weights on disk, and measure the quality change first. - [Faster generation](https://kwker.io/docs/md/hf-faster.md): Make KwkDecoder generation faster with exact speculative decoding - prompt lookup and a small draft model - and with several sequences per step. - [Chat and serving](https://kwker.io/docs/md/hf-serve.md): Serve a Hugging Face language model on the CPU - reuse earlier chat turns, batch many requests together, and expose an OpenAI-compatible API. - [Sentence embeddings](https://kwker.io/docs/md/hf-embeddings.md): Compute sentence embeddings from a BERT-family Hugging Face model on the CPU with KwkEncoder, in float or int8, and check them against the original. - [ONNX Runtime](https://kwker.io/docs/md/onnxruntime.md): Run an ONNX embedding model through ONNX Runtime with Kwker underneath - same results as ONNX Runtime's CPU provider, about 1.5x faster. - [Classify images](https://kwker.io/docs/md/vision.md): Classify images on the CPU with KwkCNN - check that a torchvision model is supported, run it in float32, then in int8 calibrated on your own photos. - [Accelerate JAX](https://kwker.io/docs/md/jax.md): Sort, argsort, top-k and rank JAX arrays on the CPU with Kwker, inside jit and vmap and with gradients, as XLA custom calls with no host copies. - [Data and analytics](https://kwker.io/docs/md/data.md): Speed up data work with Kwker - NumPy without code changes, pandas, Polars and pyarrow tables, DuckDB queries, sparse matrices and files larger than memory. - [NumPy drop-in](https://kwker.io/docs/md/numpy.md): Run NumPy's sort, argsort, partition, unique, searchsorted and set operations on Kwker in an existing program, with no code change. - [SciPy drop-in](https://kwker.io/docs/md/scipy.md): Run SciPy's sparse-matrix conversions, rank statistics and window filters on Kwker in an existing program with one line, with SciPy's exact results. - [DataFrames, Arrow and DuckDB](https://kwker.io/docs/md/dataframes.md): Sort, take the top rows of and group pandas, Polars and pyarrow tables, Arrow arrays and DuckDB results with Kwker. - [Polars](https://kwker.io/docs/md/polars.md): Sort, take the top rows of and group Polars DataFrames faster with kwker.frame - a Polars DataFrame in, a Polars DataFrame out, the rows Polars gives. - [Tutorial: group-by on a table](https://kwker.io/docs/md/tutorial-groupby.md): Total sales per store in a pandas table with Kwker - revenue, order count and median order per store, the best stores first - then five million rows. - [Tutorial: ORDER BY in DuckDB](https://kwker.io/docs/md/tutorial-duckdb.md): Use Kwker for ORDER BY, ORDER BY ... LIMIT and GROUP BY on a DuckDB table, get DuckDB relations back, and check the results against DuckDB's SQL. - [Tutorial: sort a file larger than memory](https://kwker.io/docs/md/tutorial-external-sort.md): Sort a binary file bigger than the memory you give it - keys and then fixed-size records - check the result, and follow progress as it runs. - [Tutorial: rank a leaderboard](https://kwker.io/docs/md/tutorial-leaderboard.md): Build a game leaderboard in Python - ranks with ties, a sorted table with a tiebreak, and the top three - then check it on a million players. - [Tutorial: top-k recommendations](https://kwker.io/docs/md/tutorial-recommendations.md): Pick the three best items for every user from a table of scored candidates, skip what they already bought, and scale it to a million candidates. - [Use Kwker from C and C++](https://kwker.io/docs/md/lang-cpp.md): Add Kwker to a C or C++ project with CMake or pkg-config - the project file, a complete program, the build commands and how errors are reported. - [Use Kwker from Rust](https://kwker.io/docs/md/lang-rust.md): Add the kwker crate to a Rust project - Cargo.toml, a complete program, the build requirements, cargo features and how errors are reported. - [Use Kwker from Java](https://kwker.io/docs/md/lang-java.md): Call Kwker from Java with kwker.jar - a complete program, the compile and run commands, the Java versions it supports and how errors are reported. - [Use Kwker from C# and .NET](https://kwker.io/docs/md/lang-csharp.md): Add Kwker to a .NET project - the package reference, a complete C# program, the build commands, the supported types and how errors are reported. - [Use Kwker from Go](https://kwker.io/docs/md/lang-go.md): Use Kwker from a Go module - install the C package, go get the module, run a complete program, and see how errors and panics are reported. - [Use Kwker from JavaScript](https://kwker.io/docs/md/lang-js.md): Use Kwker from JavaScript and TypeScript - the Node-API package for Node.js and Bun, the WebAssembly build for browsers and Deno, and a complete program. ## Fundamentals - [Core concepts](https://kwker.io/docs/md/concepts.md): What you control in every Kwker call - in place or a copy, threads, sort order, memory and errors - and the few edge cases. - [Behavior specification](https://kwker.io/docs/md/behavior.md): The exact rules every Kwker operation follows - key order, NaN and signed zero, stability, selection, threads and engines - each with the test that checks it. - [All operations](https://kwker.io/docs/md/operations.md): Every Kwker operation on one page, from sorting and top-k to ranks, searches, groups, sets and data larger than memory. - [Runtime controls](https://kwker.io/docs/md/cpu-runtime.md): See which engine runs on your machine, and control engines, algorithm classes, threads and memory at run time or with environment variables. - [Performance](https://kwker.io/docs/md/performance.md): Get the most speed from Kwker - ask only for what you need, sort in place, one call per matrix, threads for big arrays - and measure the result on your own machine. - [Glossary](https://kwker.io/docs/md/glossary.md): Plain definitions of the technical terms in the Kwker documentation, from argsort and NaN to AVX-512, bfloat16 and the KV cache. ## How-to guides - [How-to guides](https://kwker.io/docs/md/guides.md): Task-by-task guides for Kwker: sorting, top-k, ranks, searches, keys with values, strings, groups and data larger than memory. - [Sorting](https://kwker.io/docs/md/sorting.md): Sort arrays in place or into a copy, in ascending or descending order, row by row and on several cores. - [Top-k and selection](https://kwker.io/docs/md/top-k.md): Find the k largest or smallest values, the median or any position of the sorted order without sorting the whole array. - [Order and ranking](https://kwker.io/docs/md/ordering.md): Get the order of an array with argsort, reorder several columns together, compute ranks and sort by several columns. - [Searching sorted data](https://kwker.io/docs/md/searching.md): Find where values go in sorted data with searchsorted, put values into buckets with bucketize, and count them with bucket_counts. - [Sorting keys with values](https://kwker.io/docs/md/key-value.md): Sort keys and their values together, keep equal keys in their original order, or take only the first k pairs. - [Strings](https://kwker.io/docs/md/strings.md): Sort lists and NumPy arrays of strings by bytes, ignoring ASCII case or in natural order, and sort mainframe data by its collating sequence. - [Groups, merges and sets](https://kwker.io/docs/md/groups.md): Total values per key, number the groups of several key columns, merge sorted lists and compute set operations on sorted arrays. - [Statistics and data helpers](https://kwker.io/docs/md/statistics.md): Running totals and ranks within groups, expanding medians, trimmed means, weighted quantiles, histograms, as-of joins and sampling filters. - [Large data](https://kwker.io/docs/md/large-data.md): Sort large arrays on several cores, limit the extra memory a sort uses, sort files larger than memory and sort across machines. - [Sparse matrices](https://kwker.io/docs/md/sparse.md): Build CSR and CSC sparse matrices from (row, column, value) entries, combine duplicates and convert between formats with Kwker. - [4-bit packed values](https://kwker.io/docs/md/packed-int4.md): Sort, order and take the top values of 4-bit numbers stored two per byte - the int4 layout of GGML, ONNX and PyTorch's quint4x2 - without unpacking them. ## Languages - [Languages](https://kwker.io/docs/md/languages.md): Call Kwker from Go, JavaScript, Java, C#, Ruby, PHP, Perl, R, Swift, Objective-C, Zig, MATLAB, Fortran, COBOL and assembly. - [Kwker for WebAssembly](https://kwker.io/docs/md/wasm.md): Use Kwker in browsers and in Node.js through its WebAssembly module and JavaScript interface, with the same order rules as every other language. - [Kwker for Swift](https://kwker.io/docs/md/swift.md): Use Kwker from Swift on macOS, iOS and Linux through its Swift package and XCFramework over the C library. - [Kwker for Objective-C](https://kwker.io/docs/md/objc.md): Use Kwker from Objective-C with Apple Foundation or GNUstep, through Swift Package Manager or CocoaPods. - [Kwker for Zig](https://kwker.io/docs/md/zig.md): Use Kwker from Zig through its build.zig.zon package over the C library, with slices of every key type. - [Kwker for MATLAB and GNU Octave](https://kwker.io/docs/md/matlab.md): Use Kwker from MATLAB and GNU Octave through a MEX package with sort, maxk, mink and kth. ## Reference - [API reference](https://kwker.io/docs/md/reference.md): The Kwker API reference for every language: each function with its signature, parameters, results and errors. - [Python API reference](https://kwker.io/docs/md/reference-python.md): Every public function and class of the Kwker Python package and its modules, with its signature, arguments and results. - [Rust API reference](https://kwker.io/docs/md/reference-rust.md): Every public function and type of the kwker Rust crate, with its signature, parameters and return values. - [C API reference](https://kwker.io/docs/md/reference-c.md): Every function, type and constant of the Kwker C library (kwker.h), with its parameters, return codes and key types. - [C++ API reference](https://kwker.io/docs/md/reference-cpp.md): Every class, function and constant of the header-only Kwker C++ interface (kwker.hpp), with its parameters and errors. - [Go API reference](https://kwker.io/docs/md/reference-go.md): Every public function of the Kwker Go package, with its signature, parameters and return values. - [JavaScript / TypeScript API reference](https://kwker.io/docs/md/reference-js.md): Every public function of the Kwker JavaScript / TypeScript package, with its signature, parameters and return values. - [Java API reference](https://kwker.io/docs/md/reference-java.md): Every public function of the Kwker Java package, with its signature, parameters and return values. - [C# API reference](https://kwker.io/docs/md/reference-csharp.md): Every public function of the Kwker C# package, with its signature, parameters and return values. - [Ruby API reference](https://kwker.io/docs/md/reference-ruby.md): Every public function of the Kwker Ruby package, with its signature, parameters and return values. - [R API reference](https://kwker.io/docs/md/reference-r.md): Every public function of the Kwker R package, with its signature, parameters and return values. - [PHP API reference](https://kwker.io/docs/md/reference-php.md): Every public function of the Kwker PHP package, with its signature, parameters and return values. - [Perl API reference](https://kwker.io/docs/md/reference-perl.md): Every public function of the Kwker Perl package, with its signature, parameters and return values. - [Swift API reference](https://kwker.io/docs/md/reference-swift.md): Every public function of the Kwker Swift package, with its signature, parameters and return values. - [Objective-C API reference](https://kwker.io/docs/md/reference-objc.md): Every public function of the Kwker Objective-C package, with its signature, parameters and return values. - [Zig API reference](https://kwker.io/docs/md/reference-zig.md): Every public function of the Kwker Zig package, with its signature, parameters and return values. - [MATLAB / Octave API reference](https://kwker.io/docs/md/reference-matlab.md): Every public function of the Kwker MATLAB / Octave package, with its signature, parameters and return values. - [Fortran API reference](https://kwker.io/docs/md/reference-fortran.md): Every public function of the Kwker Fortran package, with its signature, parameters and return values. - [COBOL API reference](https://kwker.io/docs/md/reference-cobol.md): Every public function of the Kwker COBOL package, with its signature, parameters and return values. - [Command-line reference](https://kwker.io/docs/md/commands.md): Every Kwker command - sort, top, count, unique and rank for files, then doctor, support-bundle, bench, audit, serve and torch_run - with its options. ## What's new - [Kwker 0.1.0 release notes](https://kwker.io/docs/md/release-notes.md): What Kwker 0.1.0 contains: its speed against other libraries, its operations and platforms, its compatibility promise and its limits. - [Kwker compatibility](https://kwker.io/docs/md/compatibility.md): The Kwker 0.1.x compatibility promise: what stays stable between releases, how features are deprecated, and which versions get fixes. ## Help - [Troubleshooting](https://kwker.io/docs/md/troubleshooting.md): Fix doctor warnings, find answers to common questions, find out whether Kwker causes a problem, and report one. - [Known limitations](https://kwker.io/docs/md/limitations.md): What Kwker 0.1.0 does not do yet: the known limits of its speed, platforms, packages, operations and PyTorch support. - [Licensing](https://kwker.io/docs/md/licensing.md): Which Kwker license applies to you - free PolyForm Small Business, the Kwker Commercial License or the OEM license - and what each one allows. ## Archive - [PyTorch and JAX (archived)](https://kwker.io/docs/md/archive-pytorch-jax.md): Archived - the earlier single page on Kwker for PyTorch and JAX, replaced by the Accelerate PyTorch and Accelerate JAX pages. - [Tutorials (archived)](https://kwker.io/docs/md/archive-tutorials.md): Archived - the earlier Tutorials page, a flat list of step-by-step lessons, replaced by the tutorials grouped by workflow. ## Optional - [Home](https://kwker.io/): Kwker makes language models, embeddings, image models, dataframes and analytics faster on the CPUs you already run. Same results, no rewrite. - [Benchmarks](https://kwker.io/benchmarks/): Kwker benchmarked against llama.cpp, OpenVINO, pandas, Polars, DuckDB, x86-simd-sort and VQSort: method, results, wins and losses. - [Language models](https://kwker.io/llm/): Run Llama-family language models on CPU with KwkDecoder: 1.7x faster generation and 3.1x faster prompts than llama.cpp with 4-bit weights. - [Image models](https://kwker.io/vision/): Classify, tag and filter images on CPU servers with KwkCNN: int8 inference 1.6x faster than OpenVINO int8 (geometric mean of eight standard classifiers). - [DataFrames](https://kwker.io/data/): Group-by, sorting and top-k for pandas, Polars, pyarrow and DuckDB: 1.5x faster than Polars and 6.3x faster than pandas on group-by. - [Pricing](https://kwker.io/pricing/): Kwker is free for companies under 100 people and about $1.3M revenue. Larger organizations pay one yearly license by revenue; vendors get OEM. - [News](https://kwker.io/news/): What is new in Kwker: releases, benchmarks and changes, with the numbers behind them. - [Support](https://kwker.io/support/): Get help with Kwker: the documentation, a bug report or question form, security reports and license or enterprise inquiries.