-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for a bug report that matches the one I want to file, without success.
Surf Version
1.4.3-beta.0
What operating system(s) are you using?
macOS
Operating System Version
MacOS Tahoe 26.3
What arch are you using?
arm64 (including Apple Silicon)
Expected Behavior
The PDF upload / sidebar integration should extract text from the PDF and send that text to the local model.
The model should be able to summarize, answer questions, and generally interact with the document content, similar to when plain text is pasted.
Actual Behavior
With the PDF upload / sidebar flow and local models:
-
llama3.1:8b responds that the PDF appears to be encrypted or unreadable.
-
phi4-mini:3.8b responds that the PDF appears to be a random string of characters/symbols.
With the same document, if copy a passage from the PDF and paste it as plain text into a chat, both models work correctly and answer questions about the content.
Additional Information
This is the case across many PDF documents, which I know are not encrypted. This makes context-aware chats unusable when dealing with PDFs. I can't test this using ChatGPT, Claude, or Gemini.
I'm not very knowledgeable about how Surf works, but my guess is that Surf is currently passing the PDF (or some binary/base64 representation) directly to the model, rather than extracting text before calling my local models. Is Surf expected to run a PDF‑to‑text pipeline when using custom/Ollama backends, or is this only implemented for the previous hosted AI service?
Steps to Reproduce:
-
Configure Surf to use a local AI backend via Ollama:
Endpoint: http://localhost:11434
Default model: llama3.1:8b (also tested with phi4-mini:3.8b). -
In Surf, upload a regular text‑based PDF through Finder (not scanned, not copy/paste from Preview).
-
Open the PDF in Surf.
-
Open the AI sidebar and ask a question like:
“Summarize the contents of this page.”
“What is the main argument in this PDF?” -
Observe the model response.
(As a control, start a new note with the same model in Surf, upload the same PDF directly into the chat via "Add Context", and ask a similar question. This returned the same response as using the sidebar).
(As a second control, copy a few paragraphs from the PDF, paste them as plain text into a chat with the same model, and ask a question. This works perfectly fine for me).