Spaces:
Running
Running
Download connectors.html from moebiusT7/book-ocr-studio: direct link, hf CLI and curl.
- Browser
- Download file 7.03 kB
-
https://huggingface.co/spaces/moebiusT7/book-ocr-studio/resolve/main/connectors.html
- Command line
-
hf download hf://spaces/moebiusT7/book-ocr-studio/connectors.html
-
curl -L -o connectors.html https://huggingface.co/spaces/moebiusT7/book-ocr-studio/resolve/main/connectors.html
7.03 kB
| <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Optional OpenAI-compatible vision connector</title><style>body{margin:0;background:#f5f4ef;color:#18342f;font:17px/1.65 system-ui,sans-serif}main{max-width:900px;margin:auto;padding:35px 24px}a{color:#215947}h1{line-height:1.2}pre{background:#e8ebe3;padding:18px;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere}code{font-size:.88em}table{border-collapse:collapse;display:block;overflow:auto}td,th{padding:9px;border:1px solid #becbbf;text-align:left}nav{margin-bottom:32px}</style></head><body><main><nav><a href="index.html">Book OCR Studio</a> 路 <a href="install.html">Install</a> 路 <a href="benchmarks.html">Comparison</a> 路 <a href="release-notes.html">Release notes</a></nav><h1>Optional OpenAI-compatible vision connector</h1> | |
| <p><strong>Gemma 4 with M枚bius Custom C1 for OCR remains the recommended default.</strong> | |
| The optional connector lets you use another locally hosted or remote model at | |
| your discretion. OpenAI-compatible describes an API shape, not equivalent model | |
| behavior. It does not guarantee image input, structured responses, completion | |
| of a book, or correction accuracy. The historical Gemma comparison does not | |
| establish performance for other models or servers.</p> | |
| <h2>Requirements</h2> | |
| <ul> | |
| <li>A <strong>vision-capable LLM</strong> that accepts image data URLs in Chat Completions | |
| messages. A text-only LLM cannot check the original page image.</li> | |
| <li>A server implementing <code>POST /chat/completions</code> under the configured API base | |
| URL, non-streaming <code>choices[].message.content</code>, and JSON text responses.</li> | |
| <li>Sufficient model context, output budget, memory and server timeout for page | |
| images plus OCR. Passing a small connection test does not establish these | |
| limits for a full book.</li> | |
| </ul> | |
| <p>This connector does not implement the Responses API, vendor-specific image | |
| upload APIs, tool calls, streaming or server/model installation. The application | |
| still runs OCR locally and needs its OCR dependencies.</p> | |
| <h2>Setup</h2> | |
| <ol> | |
| <li>In <strong>Review provider</strong>, select <strong>Advanced: OpenAI-compatible API</strong>.</li> | |
| <li>Enter the API base URL, such as <code>http://127.0.0.1:1234/v1</code>, and the exact vision | |
| model identifier exposed by that server. Do not append <code>/chat/completions</code>.</li> | |
| <li>Enter an API key if required. Choose <code>json_schema</code> when supported; otherwise | |
| try <code>json_object</code> or <code>prompt</code>. Local correction validation remains enabled | |
| in all three modes. Select the output token parameter your server accepts: | |
| <code>max_tokens</code> or <code>max_completion_tokens</code>. | |
| <strong>Reasoning effort</strong> is optional and server-dependent. <code>server_default</code> sends | |
| no parameter; <code>none</code> can disable thinking when the server/model supports it, | |
| leaving the token budget for the JSON answer. Unsupported values may be | |
| rejected or interpreted differently by a provider. The connector does not | |
| silently change this setting. See the <a href="https://docs.ollama.com/api/openai-compatibility">Ollama compatibility reference</a> for that server.</li> | |
| <li>Read the destination notice and enable the consent checkbox. Click | |
| <strong>Test vision connection and enable</strong>. This sends only a generated image | |
| containing a random code and requests a JSON answer; it sends no book pages.</li> | |
| <li>After the test passes, start a PDF, image or Kindle job normally. Changing | |
| any connection setting requires another test. Re-selecting local Gemma | |
| restores the default provider for new jobs.</li> | |
| </ol> | |
| <p>Use HTTPS for remote servers. Plain HTTP is accepted only for loopback | |
| addresses or <code>localhost</code>; a LAN IP without TLS is rejected. For a local-only | |
| server on another machine, an explicitly configured SSH loopback tunnel is | |
| one option. URLs containing credentials or query strings are rejected. | |
| Redirects are not followed, and environment HTTP proxy settings are not used. | |
| These restrictions do not certify the trustworthiness of the chosen endpoint.</p> | |
| <h2>Privacy and credentials</h2> | |
| <p>The default Gemma workflow is local. With this optional connector enabled, | |
| <strong>page images, OCR text and review prompts are sent to the selected endpoint</strong>. | |
| Remote providers may retain data and charge for requests. Review, verification, | |
| repair and split-page requests can produce multiple calls per page. Choose an | |
| endpoint and content you are comfortable sending; the app does not automatically | |
| switch to a cloud provider when local review fails.</p> | |
| <p>Connection profiles, including API keys, are stored as <strong>plaintext</strong> JSON under | |
| <code>.connector-profiles/</code>, with directory mode 0700 and file mode 0600. This is | |
| filesystem access control, not encryption or a system keychain. Profiles are | |
| excluded from job ZIP exports and the public source package. Do not publish or | |
| share that directory. The profile identifier is saved in each job; the API key | |
| is not. Profile files are immutable through the UI, so changing settings does | |
| not silently redirect a saved job to another endpoint.</p> | |
| <p>To revoke access, revoke the key at the provider and remove the corresponding | |
| local profile when no job needs it. Saved jobs referencing a missing or invalid | |
| profile fail explicitly; they do not fall back to another provider. Starting | |
| a fresh job after testing a new connection creates a new profile. Avoid | |
| credentials in model names or document names. Provider error bodies are not | |
| copied into job errors.</p> | |
| <h2>Execution and output</h2> | |
| <p>For this connector, OCR completes before model review starts. The app does not | |
| control the external server's GPU placement, model loading, VRAM recovery or | |
| request concurrency, even when that server runs on the same computer. The | |
| local Gemma shared/dual GPU scheduler does not apply to that server.</p> | |
| <p>The existing C1 OCR instructions, correction validation, image checks and | |
| source-preservation path are retained. A different model may follow these | |
| instructions differently. Requests that time out, refuse, return invalid JSON | |
| or exceed output limits can leave partial results. Original OCR and completed | |
| pages remain available. Unapproved model suggestions never silently replace | |
| original OCR in the reading text. Review important names, numbers and passages | |
| against the source images.</p> | |
| <p>The connection test checks one small image/JSON exchange only. It is not a | |
| supported-model list, an accuracy benchmark, or a full-book completion guarantee.</p> | |
| <p>The app also accepts an entire valid JSON response wrapped in one Markdown code | |
| fence. It does not extract JSON from a response containing surrounding commentary. | |
| The connection probe still requires the exact image code; a timeout, token limit | |
| or wrong reading leaves the connector disabled.</p> | |
| <hr><p><a href="CONNECTORS.md" download>Download original text</a></p></main></body></html> | |