Search the way customers talk.
With a model tuned on your data.
An open embedding model, fine-tuned on a Chalk GPU for a parts catalog, served as a Chalk function and called straight from ChalkSQL. Describe a part in your own words and compare the base and tuned models on the same query.
Describe a part
Each search runs as two ChalkSQL queries, one per model, against the same catalog. The suggested searches come from products the model never trained on. Ironbark Supply and its 1,002-item catalog are fictional, generated for this demo.
A small model that knows the trade
800 searches for 200 products the model never saw in training, each ranked against all 1,002 items. Fine-tuning took 12.7 seconds on one NVIDIA L4.
It is not free everywhere. Matching a new supplier's terse price-file lines to the catalog is jargon to jargon, and there the base model got 58 of 60 lines right and the tuned one 55. Keep both deployed, and let each query pick the model that fits its job.
How it works
Off-the-shelf embedding models know general English, not your catalog. A few thousand labeled searches teach them your vocabulary, and Chalk runs every step from training to the query.
Label your domain
1,002 catalog items for a fictional parts distributor, each with four searches written the way customers talk: symptoms, jobs and nicknames, never the trade name. Uploaded as one Chalk dataset.
Fine-tune on a GPU
A Chalk training run fine-tunes all-MiniLM-L6-v2 on an NVIDIA L4 with in-batch negatives: 3 epochs over 3,208 search-to-product pairs in 12.7 seconds. A fifth of the products are held out entirely.
Serve as a function
The base and tuned models deploy as two Chalk functions on CPU. Each registers in the environment's catalog, so SQL, feature resolvers and chalkdf can all call it by name.
Query in SQL
catalog_call embeds the search inside the query, and cosine_similarity_vector ranks it against the catalog's stored vectors. One more query embedded the whole catalog in the first place.
Your model, callable from SQL
Fine-tune with a Chalk training run, deploy the result as a Chalk function, and every query in the environment can call it by name. The example repository has the data generator, training run, functions, catalog embedding query and this demo page.
The same pattern works for any model with a vector or a label to return: rerankers, classifiers, image or code embeddings.
chalk-ai/sql-custom-embeddings-- The visitor's words are embedded by the fine-tuned model, a Chalk
-- function, then ranked against the catalog's stored vectors.
WITH q AS (
SELECT catalog_call(
'function.ironbark-embed-tuned',
'my hydraulic cylinder drifts down when the pump shuts off'
) AS v
)
SELECT p.sku, p.name,
cosine_similarity_vector(p.tuned_vec, q.v) AS score
FROM read_parquet('gs://<bucket>/catalog.parquet') AS p
CROSS JOIN q
ORDER BY score DESC
LIMIT 5
-- sku name score
-- IB-85642 Hydraulic Cartridge Check Valve, SAE-10, 5000 PSI 0.393
-- IB-67688 Axial Piston Pump, Variable Displacement, 45 cc 0.387What Chalk handles
Training runs on Chalk GPUs
chalkcompute.training takes a dataset, an image and a GPU type, runs your function, and writes the model to a Chalk volume. No cluster to manage.
Any model is a SQL function
A deployed function is callable from ChalkSQL with catalog_call, alongside joins, filters and aggregations over every connected source.
Vectors are just columns
Store embeddings in parquet, tables or features, and compare them with cosine_similarity_vector or dot_product_vector anywhere in a query.
Measure before you switch
Both models stay deployed side by side, so a single query compares them on your own data before you move any traffic.
No secrets in the app
The demo page runs its SQL as its own Chalk workload identity, a short-lived token the platform mounts and rotates. No client secret ships with it.
Batch and online, one function
The same function embedded 1,002 catalog items in one query and answers each live search in about 1.5 seconds, SQL included.
Bring your own embedding model
Fine-tune it on your data, serve it next to your features, and query it in SQL. Talk to an engineer about your search, matching or recommendation problem.