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](https://hanxiao.io/2018/09/28/Fashion-MNIST-Year-In-Review/). No extra dependencies needed, simply do:

jina hello-world

…or even easier for Docker users, no any install required, simply:

docker run -v "$(pwd)/j:/j" jinaai/jina:devel hello-world --workdir /j --logserver && open j/hello-world.html

It downloads 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, asks Jina to retrieve relevant results. After about 1 minute, it will open a webpage and show results like this:


And the implementation behind? As simple as it should be:

Python API
from jina.flow import Flow

f = Flow.load_config('index.yml')

with f:
YAML spec
    yaml_path: helloworld.crafter.yml
    replicas: $REPLICAS
    read_only: true
    yaml_path: helloworld.indexer.doc.yml
    yaml_path: helloworld.encoder.yml
    needs: chunk_seg
    replicas: $REPLICAS
    yaml_path: helloworld.indexer.chunk.yml
    replicas: $SHARDS
    separated_workspace: true
    yaml_path: _merge
    needs: [doc_idx, chunk_idx]
    read_only: true
Flow in Dashboard

All big words you can name: computer vision, neural IR, microservice, message queue, elastic, replicas & shards 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)/tmp:/workspace jinaai/jina:devel hello-world --workdir /workspace --logserver && open tmp/hello-world.html

More Options on “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] [--logserver] [--logserver-config]
                        [--download-proxy] [--shards] [--replicas]
                        [--index-yaml-path] [--index-data-url]
                        [--index-batch-size] [--query-yaml-path]
                        [--query-data-url] [--query-batch-size] [--num-query]

general arguments


the workdir for hello-world demo, all data, indices, shards and outputs will be saved there

Default: “e3a6141ca5”


start a log server for the dashboard

Default: False


the yaml config of the log server

Default: “/home/runner/work/jina/jina/jina/resources/logserver.default.yml”


specify the proxy when downloading sample data

scalability arguments


number of shards when index and query

Default: 2


number of replicas when index and query

Default: 2

index arguments


the yaml path of the index flow

Default: “/home/runner/work/jina/jina/jina/resources/helloworld.flow.index.yml”


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


the batch size in indexing

Default: 1024

query arguments


the yaml path of the query flow

Default: “/home/runner/work/jina/jina/jina/resources/helloworld.flow.query.yml”


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


the batch size in searching

Default: 32


number of queries to visualize

Default: 128


top-k results to retrieve and visualize

Default: 50