• Stars
    star
    3,126
  • Rank 13,805 (Top 0.3 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created about 1 month ago
  • Updated 24 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Convert any URL to an LLM-friendly input with a simple prefix https://r.jina.ai/

Reader

Your LLMs deserve better input.

Reader converts any URL to an LLM-friendly input with a simple prefix https://r.jina.ai/. Get improved output for your agent and RAG systems at no cost.

Feel free to use Reader API in production. It is free, stable and scalable. We are maintaining it actively as one of the core products of Jina AI.

image

Updates

  • 2024-04-24: You now have more fine-grained control over Reader API using headers, e.g. forwarding cookies, using HTTP proxy.
  • 2024-04-15: Reader now supports image reading! It captions all images at the specified URL and adds Image [idx]: [caption] as an alt tag (if they initially lack one). This enables downstream LLMs to interact with the images in reasoning, summarizing etc. See example here.

Usage

Simply prepend https://r.jina.ai/ to any URL. For example, to convert the URL https://en.wikipedia.org/wiki/Artificial_intelligence to an LLM-friendly input, use the following URL:

https://r.jina.ai/https://en.wikipedia.org/wiki/Artificial_intelligence

All images in that page that lack alt tag are auto-captioned by a VLM (vision langauge model) and formatted as !(Image [idx]: [VLM_caption])[img_URL]. This should give your downstream text-only LLM just enough hints to include those images into reasoning, selecting, and summarization.

Streaming mode

Streaming mode is useful when you find that the standard mode provides an incomplete result. This is because the Reader will wait a bit longer until the page is stablely rendered. Use the accept-header to toggle the streaming mode:

curl -H "Accept: text/event-stream" https://r.jina.ai/https://en.m.wikipedia.org/wiki/Main_Page

The data comes in a stream; each subsequent chunk contains more complete information. The last chunk should provide the most complete and final result. If you come from LLMs, please note that it is a different behavior than the LLMs' text-generation streaming.

For example, compare these two curl commands below. You can see streaming one gives you complete information at last, whereas standard mode does not. This is because the content loading on this particular site is triggered by some js after the page is fully loaded, and standard mode returns the page "too soon".

curl -H 'x-no-cache: true' https://access.redhat.com/security/cve/CVE-2023-45853
curl -H "Accept: text/event-stream" -H 'x-no-cache: true' https://r.jina.ai/https://access.redhat.com/security/cve/CVE-2023-45853

Note: -H 'x-no-cache: true' is used only for demonstration purposes to bypass the cache.

Streaming mode is also useful if your downstream LLM/agent system requires immediate content delivery or needs to process data in chunks to interleave I/O and LLM processing times. This allows for quicker access and more efficient data handling:

Reader API:  streamContent1 ----> streamContent2 ----> streamContent3 ---> ... 
                          |                    |                     |
                          v                    |                     |
Your LLM:                 LLM(streamContent1)  |                     |
                                               v                     |
                                               LLM(streamContent2)   |
                                                                     v
                                                                     LLM(streamContent3)

Note that in terms of completeness: ... > streamContent3 > streamContent2 > streamContent1, each subsequent chunk contains more complete information.

Using request headers

As you have already seen above, one can control the behavior of the Reader API using request headers. Here is a complete list of supported headers.

  • You can ask the Reader API to forward cookies settings via the x-set-cookie header.
    • Note that requests with cookies will not be cached.
  • You can bypass readability filtering via the x-respond-with header, specifically:
    • x-respond-with: markdown returns markdown without going through reability
    • x-respond-with: html returns documentElement.outerHTML
    • x-respond-with: text returns document.body.innerText
    • x-respond-with: screenshot returns the URL of the webpage's screenshot
  • You can specify a proxy server via the x-proxy-url header.
  • You can bypass the cached page (lifetime 300s) via the x-no-cache header.

JSON mode (super early beta)

This is still very early and the result is not really a "useful" JSON. It contains three fields url, title and content only. Nonetheless, you can use accept-header to control the output format:

curl -H "Accept: application/json" https://r.jina.ai/https://en.m.wikipedia.org/wiki/Main_Page

Install

You will need the following tools to run the project:

  • Node v18 (The build fails for Node version >18)
  • Firebase CLI (npm install -g firebase-tools)

For backend, go to the backend/functions directory and install the npm dependencies.

git clone [email protected]:jina-ai/reader.git
cd backend/functions
npm install

What is thinapps-shared submodule?

You might notice a reference to thinapps-shared submodule, an internal package we use to share code across our products. While it’s not open-sourced and isn't integral to the Reader's functions, it mainly helps with decorators, logging, secrets management, etc. Feel free to ignore it for now.

That said, this is the single codebase behind https://r.jina.ai, so everytime we commit here, we will deploy the new version to the https://r.jina.ai.

Having trouble on some websites?

Please raise an issue with the URL you are having trouble with. We will look into it and try to fix it.

License

Reader is backed by Jina AI and licensed under Apache-2.0.

More Repositories

1

jina

☁️ Build multimodal AI applications with cloud-native stack
Python
19,690
star
2

clip-as-service

🏄 Scalable embedding, reasoning, ranking for images and sentences with CLIP
Python
12,150
star
3

dalle-flow

🌊 A Human-in-the-Loop workflow for creating HD images from text
Python
2,814
star
4

dev-gpt

Your Virtual Development Team
Python
1,658
star
5

langchain-serve

⚡ Langchain apps in production using Jina & FastAPI
Python
1,573
star
6

finetuner

🎯 Task-oriented embedding tuning for BERT, CLIP, etc.
Python
1,402
star
7

thinkgpt

Agent techniques to augment your LLM and push it beyong its limits
Python
1,402
star
8

auto-gpt-web

Set Your Goals, AI Achieves Them.
TypeScript
743
star
9

agentchain

Chain together LLMs for reasoning & orchestrate multiple large models for accomplishing complex tasks
Python
557
star
10

docarray

The data structure for unstructured data
Python
522
star
11

vectordb

A Python vector database you just need - no more, no less.
Python
463
star
12

jcloud

Simplify deploying and managing Jina projects on Jina Cloud
Python
294
star
13

jina-video-chat

Python
266
star
14

jinabox.js

A lightweight, customizable omnibox in Javascript, for use with a Jina backend.
JavaScript
219
star
15

annlite

⚡ A fast embedded library for approximate nearest neighbor search
Python
212
star
16

fastapi-serve

FastAPI to the Cloud, Batteries Included! ☁️🔋🚀
Python
139
star
17

rungpt

An open-source cloud-native of large multi-modal models (LMMs) serving framework.
Python
134
star
18

jina-hub

An open-registry for hosting Jina executors via container images
Python
103
star
19

dashboard

Interactive UI for analyzing Jina logs, designing Flows and viewing Hub images
TypeScript
100
star
20

GoldRetriever

Create and host retrieval plugins for ChatGPT in one click
Python
61
star
21

example-multimodal-fashion-search

Input text or image, get back matching image fashion results, using Jina, DocArray, and CLIP
Python
43
star
22

jinaai-py

Python
36
star
23

docs

Jina V1 Official Documentation. For the latest one, please check out https://docs.jina.ai
HTML
34
star
24

streamlit-jina

Streamlit component for Jina neural search
Python
34
star
25

executors

internal-only
Python
28
star
26

jerboa

LLM finetuning
Python
27
star
27

jina-ai.github.io

Homepage of Jina AI Limited
HTML
26
star
28

jinaai-js

TypeScript
26
star
29

example-meme-search

Meme search engine built with Jina neural search framework. Search with captions or image files to find matching memes.
Python
23
star
30

example-app-store

App store search example, using Jina as backend and Streamlit as frontend
Python
21
star
31

docsQA-ui

Web UI for docsQA. Main branch: https://jina-docqa-ui.netlify.app/
TypeScript
20
star
32

example-speech-to-image

An example of building a speech to image generation pipeline with Jina, Whisper and StableDiffusion
Python
20
star
33

jina-hubble-sdk

Python API for authentication, resource management with Hubble
Python
19
star
34

product-recommendation-redis-docarray

Python
18
star
35

career

Find out job opportunities at Jina AI
17
star
36

executor-3d-encoder

An executor that wraps 3D mesh models and encodes 3D content documents to d-dimension vector.
Python
16
star
37

client-go

Golang Client for Jina (https://github.com/jina-ai/jina)
Go
16
star
38

workshops

Jupyter Notebook
14
star
39

benchmark

Benchmark environment and results of different versions of Jina.
Python
14
star
40

action-hub-builder

Simple interface for building & validating Jina Hub executors.
Python
12
star
41

inference-client

Python
12
star
42

executor-hnsw-postgres

A production-ready, scalable Indexer for the Jina neural search framework, based on HNSW and PSQL
Python
12
star
43

now

Python
11
star
44

cookiecutter-jina

Cookiecutter template for a Jina project
Python
10
star
45

simple-jina-examples

Python
9
star
46

executor-simpleindexer

Simple Indexer
Python
9
star
47

cloud-ops

Python
8
star
48

good-first-issues

Issues that don't fit under Jina's other repos!
8
star
49

executor-clip-encoder

Encoder that embeds documents using either the CLIP vision encoder or the CLIP text encoder, depending on the content type of the document.
Python
8
star
50

api

API schema of Jina command line interface exposed as JSON and YAML files.
HTML
8
star
51

inference-client-js

TypeScript
7
star
52

executor-text-transformers-dprreader-ranker

DPRReaderRanker
Python
7
star
53

executor-video-loader

Python
7
star
54

executor-image-clip-encoder

CLIPImageEncoder is an image encoder that wraps the image embedding functionality using the CLIP
Python
7
star
55

.github

This repository stores github actions templates as described https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
7
star
56

GSoC

Google Summer of Code
7
star
57

example-wikipedia-recommendation

An example of graph embeddings for wikipedia page recommendations
Jupyter Notebook
6
star
58

executor-U100KIndexer

An Indexer that works out-of-the-box when you have less than 100K stored Documents
Python
6
star
59

devrel-heartmaker

Heart mosaics of your GitHub contributors
Python
6
star
60

executor-text-transformers-torch-encoder

**TransformerTorchEncoder** wraps the torch-version of transformers from huggingface. It encodes text data into dense vectors.
Python
6
star
61

executor-cases

Summarize all Executor patterns for Hubble
Python
5
star
62

executor-normalizer

Jina executor package normalizer
Python
5
star
63

auth

deprecated, use `jina-hubble-sdk`
Python
5
star
64

jina-commons

A collection of shared function for Jina Executor
Python
5
star
65

tutorial-notebooks

Jupyter Notebook
5
star
66

jina-paddle-hackathon

极纳 x 百度飞桨 黑客马拉松
Python
5
star
67

executor-image-preprocessor

An executor that performs standard pre-processing and normalization on images.
Python
5
star
68

jina-hackathon

Support repo for Jina X Hackathon - Sep 2020
5
star
69

executor-featurehasher

FeatureHasher
Python
4
star
70

stress-test

A collection of stress tests of Jina infrastructure
Python
4
star
71

executor-image-clip-classifier

Python
4
star
72

executor-text-transformerqa

**TransformerQAExecutor* wraps a question-answering model from huggingface and return relevant answers given questions and contexts/paragraphs.
Python
4
star
73

executor-faissindexer

A similarity search indexer based on Faiss. https://hub.jina.ai/executor/8gsd0tts
Python
4
star
74

hub-integration

Integration test for hub
Python
4
star
75

example-audio-search

Python
3
star
76

example-video-qa

This is an example of building a video QA with jina
TypeScript
3
star
77

jinad

Management of Jina on remote
Python
3
star
78

executor-indexers

Indexer Executors for Jina
Python
3
star
79

executor-text-dpr-encoder

Encode text into embeddings using the DPR model.
Python
3
star
80

jina-sagemaker

Jina Embedding Models on AWS SageMaker
Jupyter Notebook
3
star
81

executor-clip-image

Executor for the pre-trained clip model. https://openai.com/blog/clip/
Python
3
star
82

executor-weaviate-indexer

Python
3
star
83

executor-doc2query

Python
3
star
84

executor-evaluator-ranking

Python
3
star
85

legacy-examples

Unmaintained examples for Jina
Python
3
star
86

executor-image-paddle-encoder

Python
3
star
87

jupyter-notebooks

Jupyter Notebook
3
star
88

executor-yolov5

Python
3
star
89

executor-lightgbm-ranker

Python
3
star
90

terraform-jina-jinad-aws

Module for deploying JinaD on AWS
HCL
3
star
91

encoder-image-torch

The ImageTorchEncoder encodes Document content from a ndarray to an d-dimensional vector.
Python
3
star
92

executor-image-niireader

Python
2
star
93

example-odqa

Roff
2
star
94

jina-ui

Monorepo for JinaJS and frontend projects
TypeScript
2
star
95

executor-audio-clip-encoder

Wraps the AudioCLIP model for generating embeddings for audio data for the Jina framework
Python
2
star
96

executor-text-clip-encoder

Encode text into embeddings using the CLIP model.
Python
2
star
97

executor-image-normalizer

Executor that reads, resizes, crops and normalizes images.
Python
2
star
98

executor-vgg-audio-encoder

Python
2
star
99

executor-image-hasher

An executor to encode images using comparable hashing techniques. Useful for duplicate detection
Python
2
star
100

executor-image-clothing-segmenter

An executor that performs image segmentation on fashion items
Python
2
star