本地容器化部署r.jina.ai

背景

需要通过r.jina.ai解析网页或pdf文件送到下游的LLM进行分析处理,近期r.jina.ai的响应越来越慢,经常出现404错误,计划本地进行处理

部署

https://github.com/intergalacticalvariable/reader

docker pull ghcr.io/intergalacticalvariable/reader:latest

docker run -d -p 3000:3000 -v /path/to/local-storage:/app/local-storage --name reader-container ghcr.io/intergalacticalvariable/reader:latest

使用

Once the Docker container is running, you can use curl to make requests. Here are examples for different response types:

  1. 📝 Markdown (bypasses readability processing):

    curl -H "X-Respond-With: markdown" 'http://127.0.0.1:3000/https://google.com'
    
  2. 🌐 HTML (returns documentElement.outerHTML):

    curl -H "X-Respond-With: html" 'http://127.0.0.1:3000/https://google.com'
    
  3. 📄 Text (returns document.body.innerText):

    curl -H "X-Respond-With: text" 'http://127.0.0.1:3000/https://google.com'
    
  4. 📸 Screen-Size Screenshot (returns the URL of the webpage's screenshot):

    curl -H "X-Respond-With: screenshot" 'http://127.0.0.1:3000/https://google.com'
    
  5. 📸 Full-Page Screenshot (returns the URL of the webpage's screenshot):

curl -H "X-Respond-With: pageshot" 'http://127.0.0.1:3000/https://google.com'

posted on 2025-02-10 11:43  BionExit  阅读(1659)  评论(7)    收藏  举报

导航