Vespa python API
Vespa is the scalable open-sourced serving engine to store, compute and rank big data at user serving time. pyvespa
provides a python API to Vespa.
We aim for complete feature parity with Vespa, and estimate that we cover > 95% of Vespa features, with all most commonly used features supported.
If you find a Vespa feature that you are not able to express/use with pyvespa
, please open an issue.
Quick start
To get a sense of the most basic functionality, check out the Hybrid Search Quick start:
Overview of pyvespa features
Info
There are two main interfaces to Vespa:
- Control-plane API: Used to deploy and manage Vespa applications.
VespaCloud
: Control-plane interface to Vespa Cloud.VespaDocker
: Control-plane iterface to local Vespa instance (docker/podman).
- Data-plane API: Used to feed and query data in Vespa applications.
Note that VespaCloud
and Vespa
require two separate authentication methods.
Refer to the Authenticating to Vespa Cloud for details.
- Create and deploy application packages, including schemas, rank profiles,
services.xml
, query profiles etc. - Feed and retrieve documents to/from Vespa, using
/document/v1/
API. - Query Vespa applications, using
/search/
API. - Build complex queries using the
QueryBuilder
API. - Collect training data for ML using
VespaFeatureCollector
. - Evaluate Vespa applications using
VespaEvaluator
/VespaMatchEvaluator
.
Requirements
Install pyvespa
:
We recommend using uv
to manage your python environments:
uv add pyvespa
or using pip
:
pip install pyvespa
Check out the examples
Check out our wide variety of Examples that demonstrate how to use the Vespa Python API to serve various use cases.