CoolFace
Apppublic

moebiusT7/book-ocr-studio

sourceHugging Faceagpl-3.0updated 2d agoView on Hugging Face
0likes
CONNECTORS.md98 linesDownload Raw Back to root
1# Optional OpenAI-compatible vision connector2 3**Gemma 4 with Möbius Custom C1 for OCR remains the recommended default.**4The optional connector lets you use another locally hosted or remote model at5your discretion. OpenAI-compatible describes an API shape, not equivalent model6behavior. It does not guarantee image input, structured responses, completion7of a book, or correction accuracy. The historical Gemma comparison does not8establish performance for other models or servers.9 10## Requirements11 12- A **vision-capable LLM** that accepts image data URLs in Chat Completions13  messages. A text-only LLM cannot check the original page image.14- A server implementing `POST /chat/completions` under the configured API base15  URL, non-streaming `choices[].message.content`, and JSON text responses.16- Sufficient model context, output budget, memory and server timeout for page17  images plus OCR. Passing a small connection test does not establish these18  limits for a full book.19 20This connector does not implement the Responses API, vendor-specific image21upload APIs, tool calls, streaming or server/model installation. The application22still runs OCR locally and needs its OCR dependencies.23 24## Setup25 261. In **Review provider**, select **Advanced: OpenAI-compatible API**.272. Enter the API base URL, such as `http://127.0.0.1:1234/v1`, and the exact vision28   model identifier exposed by that server. Do not append `/chat/completions`.293. Enter an API key if required. Choose `json_schema` when supported; otherwise30   try `json_object` or `prompt`. Local correction validation remains enabled31   in all three modes. Select the output token parameter your server accepts:32   `max_tokens` or `max_completion_tokens`.33   **Reasoning effort** is optional and server-dependent. `server_default` sends34   no parameter; `none` can disable thinking when the server/model supports it,35   leaving the token budget for the JSON answer. Unsupported values may be36   rejected or interpreted differently by a provider. The connector does not37   silently change this setting. See the [Ollama compatibility reference](https://docs.ollama.com/api/openai-compatibility) for that server.384. Read the destination notice and enable the consent checkbox. Click39   **Test vision connection and enable**. This sends only a generated image40   containing a random code and requests a JSON answer; it sends no book pages.415. After the test passes, start a PDF, image or Kindle job normally. Changing42   any connection setting requires another test. Re-selecting local Gemma43   restores the default provider for new jobs.44 45Use HTTPS for remote servers. Plain HTTP is accepted only for loopback46addresses or `localhost`; a LAN IP without TLS is rejected. For a local-only47server on another machine, an explicitly configured SSH loopback tunnel is48one option. URLs containing credentials or query strings are rejected.49Redirects are not followed, and environment HTTP proxy settings are not used.50These restrictions do not certify the trustworthiness of the chosen endpoint.51 52## Privacy and credentials53 54The default Gemma workflow is local. With this optional connector enabled,55**page images, OCR text and review prompts are sent to the selected endpoint**.56Remote providers may retain data and charge for requests. Review, verification,57repair and split-page requests can produce multiple calls per page. Choose an58endpoint and content you are comfortable sending; the app does not automatically59switch to a cloud provider when local review fails.60 61Connection profiles, including API keys, are stored as **plaintext** JSON under62`.connector-profiles/`, with directory mode 0700 and file mode 0600. This is63filesystem access control, not encryption or a system keychain. Profiles are64excluded from job ZIP exports and the public source package. Do not publish or65share that directory. The profile identifier is saved in each job; the API key66is not. Profile files are immutable through the UI, so changing settings does67not silently redirect a saved job to another endpoint.68 69To revoke access, revoke the key at the provider and remove the corresponding70local profile when no job needs it. Saved jobs referencing a missing or invalid71profile fail explicitly; they do not fall back to another provider. Starting72a fresh job after testing a new connection creates a new profile. Avoid73credentials in model names or document names. Provider error bodies are not74copied into job errors.75 76## Execution and output77 78For this connector, OCR completes before model review starts. The app does not79control the external server's GPU placement, model loading, VRAM recovery or80request concurrency, even when that server runs on the same computer. The81local Gemma shared/dual GPU scheduler does not apply to that server.82 83The existing C1 OCR instructions, correction validation, image checks and84source-preservation path are retained. A different model may follow these85instructions differently. Requests that time out, refuse, return invalid JSON86or exceed output limits can leave partial results. Original OCR and completed87pages remain available. Unapproved model suggestions never silently replace88original OCR in the reading text. Review important names, numbers and passages89against the source images.90 91The connection test checks one small image/JSON exchange only. It is not a92supported-model list, an accuracy benchmark, or a full-book completion guarantee.93 94The app also accepts an entire valid JSON response wrapped in one Markdown code95fence. It does not extract JSON from a response containing surrounding commentary.96The connection probe still requires the exact image code; a timeout, token limit97or wrong reading leaves the connector disabled.98