Getting Started
Install Torque, start the server, and run your first search query in under five minutes.
Install
Torque is open source under MIT or Apache-2.0, at your option. Build it from source at github.com/truespar/torque, or take a published build for your platform:
Latest version: 0.7.0 (release notes and checksums)
Download torque-0.7.0-x86_64-linux.tar.gz
curl -LO https://truespar.com/releases/torque/latest/torque-0.7.0-x86_64-linux.tar.gz
tar xzf torque-0.7.0-x86_64-linux.tar.gz
cd torque-0.7.0-x86_64-linux
# Move to PATH (optional)
sudo mv torque-server torque-admin /usr/local/bin/
# Start the server
torque-server --api-key YOUR_API_KEYThe Linux tarball is signed, and every archive has a .sha256 beside it:
curl -LO https://github.com/truespar/torque/releases/download/v0.7.0/torque-0.7.0-x86_64-linux.tar.gz.sha256
sha256sum -c torque-0.7.0-x86_64-linux.tar.gz.sha256Download torque-0.7.0-x86_64-windows.zip
Invoke-WebRequest -Uri https://truespar.com/releases/torque/latest/torque-0.7.0-x86_64-windows.zip -OutFile torque.zip
Expand-Archive torque.zip -DestinationPath .
# Start the server
.\torque-0.7.0-x86_64-windows\torque-server.exe --api-key YOUR_API_KEYTo run as a Windows service, see Server Configuration.
Download torque-0.7.0-aarch64-macos.tar.gz
Apple Silicon. There is no x86_64 macOS build; on an Intel Mac, build from source with cargo build --release.
curl -LO https://truespar.com/releases/torque/latest/torque-0.7.0-aarch64-macos.tar.gz
tar xzf torque-0.7.0-aarch64-macos.tar.gz
cd torque-0.7.0-aarch64-macos
# Move to PATH (optional)
sudo mv torque-server torque-admin /usr/local/bin/
# Start the server
torque-server --api-key YOUR_API_KEYThe archive carries a .sha256 on the release but no GPG signature.
# Pull the image
docker pull truespar/torque
# Run the server
docker run -p 8108:8108 -p 8109:8109 truespar/torque
# With persistent storage and an explicit API key
docker run -d --name torque \
-p 8108:8108 -p 8109:8109 \
-v torque-data:/data \
-e TORQUE_API_KEY=YOUR_API_KEY \
truespar/torqueThe container exposes port 8108 (HTTP API and Studio) and port 8109 (the TCP ingest protocol). The /data volume holds each collection's segment files and manifest, the schemas, the keys and a realtime collection's write-ahead log, so a restart maps what is already built instead of indexing again. Omit TORQUE_API_KEY to let the server generate a bootstrap key at start - it is printed in the startup banner.
truespar/torque publishes a tag per release, so pin one rather than tracking latest: docker pull truespar/torque:0.7.0. To build the image yourself, docker build -t torque . in a clone of the repository.
Requirements
- Operating system: Windows, Linux, or macOS
- RAM: 512 MB minimum. A collection is read in place from its memory-mapped segment files, so the whole index does not have to fit in RAM; the operating system keeps the hot pages resident and reads cold ones from disk. How much RAM you want still depends on your data and queries.
- Disk: enough for each collection's segment files, and for a second copy of a collection while you publish a new version of it.
- GPU (optional): any CUDA-capable NVIDIA GPU. The published builds are CPU-only; build with
--features cudato get the GPU path.
Start the Server
The server starts two listeners:
- HTTP API on port
8108- for search, CRUD, and Studio - TCP ingest on port
8109- for high-speed binary document streaming
On startup, Torque prints the API key and port information. You will need the API key to access Studio and the HTTP API.
Tip: There are no licence keys, tiers or feature gates - every feature is available to everyone. See Server Configuration for all options.
Configuration File
Place a torque.toml file in the working directory and Torque will load it automatically:
api_key = "YOUR_API_KEY"
data_dir = "./data"
log_level = "info"See Server Configuration for all available settings.
Open Studio
Open http://localhost:8108 in your browser. Enter your API key to log in. Studio provides a search query editor, schema browser, API key management, and data import tools.
Create a Collection
A collection holds documents with a defined schema. Create one via the HTTP API:
curl -X POST http://localhost:8108/collections \
-H "X-TYPESENSE-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "products",
"fields": [
{"name": "title", "type": "string"},
{"name": "description", "type": "string"},
{"name": "price", "type": "float"},
{"name": "category", "type": "string", "facet": true},
{"name": "in_stock", "type": "bool"}
],
"default_sorting_field": "price"
}'See Collections for all field types and options.
Add Documents
Import documents using the JSONL import endpoint:
curl -X POST "http://localhost:8108/collections/products/documents/import" \
-H "X-TYPESENSE-API-KEY: YOUR_API_KEY" \
-H "Content-Type: text/plain" \
-d '{"id": "1", "title": "Running Shoes", "description": "Lightweight running shoes", "price": 89.99, "category": "Footwear", "in_stock": true}
{"id": "2", "title": "Hiking Boots", "description": "Waterproof hiking boots", "price": 149.99, "category": "Footwear", "in_stock": true}
{"id": "3", "title": "Laptop Stand", "description": "Adjustable aluminum laptop stand", "price": 49.99, "category": "Electronics", "in_stock": false}'For large datasets, use the TCP binary protocol or TQBF binary file upload. TCP streaming reaches 49K docs/s. For a collection you rebuild on a schedule, build segment files and let the server map them without indexing.
Search
Run a search query:
curl "http://localhost:8108/collections/products/documents/search?\
q=shoes&query_by=title,description&filter_by=in_stock:true&sort_by=price:asc" \
-H "X-TYPESENSE-API-KEY: YOUR_API_KEY"The response includes matching documents with highlights, facet counts, and timing information.
Typesense Compatibility
Torque implements the Typesense v30.1 REST API. Existing Typesense client libraries work without code changes - point them at your Torque server instead:
import typesense
client = typesense.Client({
'nodes': [{'host': 'localhost', 'port': '8108', 'protocol': 'http'}],
'api_key': 'YOUR_API_KEY',
'connection_timeout_seconds': 2
})
results = client.collections['products'].documents.search({
'q': 'shoes',
'query_by': 'title,description'
})Next Steps
- Server Configuration - CLI arguments, environment variables, memory limits
- Collections - schemas, field types, nested fields, aliases
- Search - query parameters, text search, prefix, typo tolerance
- Filtering - filter syntax and operators
- TCP Protocol - high-speed binary ingestion
- .NET SDK - official client library for .NET applications
- Python SDK - HTTP client and TCP ingest for Python 3.10+
- Go SDK - HTTP client and TCP ingest for Go 1.23+
- Java SDK - HTTP client and TCP ingest for Java 21+
- Node.js SDK - HTTP client and TCP ingest for Node.js 20+