Jina “Hello, World!” 👋🌍¶
As a starter, we invite you to try Jina’s “Hello, World” - a simple demo of image neural search for Fashion-MNIST. No extra dependencies needed, simply run:
jina hello-world
Or even easier for Docker users, no install required, simply for MacOS:
docker run -v "$(pwd)/j:/j" jinaai/jina hello-world --workdir /j && open j/hello-world.html
On Linux:
docker run -v "$(pwd)/j:/j" jinaai/jina hello-world --workdir /j && xdg-open j/hello-world.html

This downloads the Fashion-MNIST training and test data and tells Jina to index 60,000 images from the training set. Then, it randomly samples images from the test set as queries, and asks Jina to retrieve relevant results. After about 1 minute, it opens a web page and show results like this:

And the implementation behind it? It’s simple:
-
Python API
¶ from jina.flow import Flow f = Flow.load_config('helloworld.flow.index.yml') with f: f.index_ndarray(fashion_mnist)
-
YAML spec
¶ !Flow pods: encode: uses: helloworld.encoder.yml parallel: 2 index: uses: helloworld.indexer.yml shards: 2 separated_workspace: true
-
Flow in Dashboard
¶
All the big words you can name: computer vision, neural IR, microservice, message queue, elastic, replicas, and shards all happened in just one minute!
View “Hello World” in Jina Dashboard¶
pip install "jina[sse]"
jina hello-world --logserver
Or if you use Docker:
docker run -p 5000:5000 -v "$(pwd)/j:/j" jinaai/jina hello-world --workdir /j --logserver && open j/hello-world.html # replace "open" with "xdg-open" on Linux
More Options for “Hello, World”¶
Intrigued? Play with different options via:
jina hello-world --help
Start the hello-world demo, a simple end2end image index and search demo without any extra dependencies.
usage: jina hello-world [-h] [--workdir] [--download-proxy] [--shards]
[--parallel] [--uses-index] [--index-data-url]
[--index-labels-url] [--index-request-size]
[--uses-query] [--query-data-url] [--query-labels-url]
[--query-request-size] [--num-query] [--top-k]
General arguments¶
- --workdir
the workdir for hello-world demo, all data, indices, shards and outputs will be saved there
Default: “329c1310-5792-11eb-bfac-000d3a1cf35d”
- --download-proxy
specify the proxy when downloading sample data
Scalability arguments¶
- --shards
number of shards when index and query
Default: 2
- --parallel
number of parallel when index and query
Default: 2
Index arguments¶
- --uses-index
the yaml path of the index flow
Default: “/home/runner/work/jina/jina/jina/resources/helloworld.flow.index.yml”
- --index-data-url
the url of index data (should be in idx3-ubyte.gz format)
Default: “http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-images-idx3-ubyte.gz”
- --index-labels-url
the url of index labels data (should be in idx3-ubyte.gz format)
Default: “http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/train-labels-idx1-ubyte.gz”
- --index-request-size
the request size in indexing (the maximum number of documents that will be included in a Request before sending it)
Default: 1024
Search arguments¶
- --uses-query
the yaml path of the query flow
Default: “/home/runner/work/jina/jina/jina/resources/helloworld.flow.query.yml”
- --query-data-url
the url of query data (should be in idx3-ubyte.gz format)
Default: “http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-images-idx3-ubyte.gz”
- --query-labels-url
the url of query labels data (should be in idx3-ubyte.gz format)
Default: “http://fashion-mnist.s3-website.eu-central-1.amazonaws.com/t10k-labels-idx1-ubyte.gz”
- --query-request-size
the request size in searching (the maximum number of documents that will be included in a Request before sending it)
Default: 32
- --num-query
number of queries to visualize
Default: 128
- --top-k
top-k results to retrieve and visualize
Default: 50