[GH-ISSUE #422] Error: Post "http://localhost:11434/api/generate": EOF with long propmts with phind-codellama #62230

Closed
opened 2026-05-03 07:57:27 -05:00 by GiteaMirror · 20 comments
Owner

Originally created by @tomduncalf on GitHub (Aug 26, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/422

It seems like if you provide a long prompt (I was using one of 1,000ish tokens according to OpenAI tokenizer) with this model, you get an error Error: Post "http://localhost:11434/api/generate": EOF. It may or may not relate to the contents of the prompt as well as the length

Originally created by @tomduncalf on GitHub (Aug 26, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/422 It seems like if you provide a long prompt (I was using one of 1,000ish tokens according to OpenAI tokenizer) with this model, you get an error `Error: Post "http://localhost:11434/api/generate": EOF`. It may or may not relate to the contents of the prompt as well as the length
GiteaMirror added the bug label 2026-05-03 07:57:27 -05:00
Author
Owner

@hmottestad commented on GitHub (Aug 26, 2023):

Here is an example:

ollama run phind-codellama " Finished the method marked as TODO in the following Java code:\n\n\npackage org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents;\n\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport org.eclipse.rdf4j.model.IRI;\nimport org.eclipse.rdf4j.model.Literal;\nimport org.eclipse.rdf4j.model.Model;\nimport org.eclipse.rdf4j.model.Resource;\nimport org.eclipse.rdf4j.model.Value;\nimport org.eclipse.rdf4j.model.vocabulary.SHACL;\nimport org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent;\nimport org.eclipse.rdf4j.sail.shacl.ValidationSettings;\nimport org.eclipse.rdf4j.sail.shacl.ast.SparqlFragment;\nimport org.eclipse.rdf4j.sail.shacl.ast.StatementMatcher;\nimport org.eclipse.rdf4j.sail.shacl.ast.StatementMatcher.Variable;\nimport org.eclipse.rdf4j.sail.shacl.ast.ValidationApproach;\nimport org.eclipse.rdf4j.sail.shacl.ast.ValidationQuery;\nimport org.eclipse.rdf4j.sail.shacl.ast.paths.Path;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.BulkedExternalLeftOuterJoin;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.EmptyNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.GroupByFilter;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.PlanNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.PlanNodeProvider;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ShiftToPropertyShape;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.TrimToTarget;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.UnBufferedPlanNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.UnionNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.Unique;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ValidationTuple;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ValueInFilter;\nimport org.eclipse.rdf4j.sail.shacl.ast.targets.EffectiveTarget;\nimport org.eclipse.rdf4j.sail.shacl.wrapper.data.ConnectionsGroup;\nimport org.eclipse.rdf4j.sail.shacl.wrapper.data.RdfsSubClassOfReasoner;\n\npublic class HasValueConstraintComponent extends AbstractConstraintComponent {\n\n	private final Value hasValue;\n\n	public HasValueConstraintComponent(Value hasValue) {\n		this.hasValue = hasValue;\n	}\n\n	@Override\n	public void toModel(Resource subject, IRI predicate, Model model, Set<Resource> cycleDetection) {\n		model.add(subject, SHACL.HAS_VALUE, hasValue);\n	}\n\n	@Override\n	public SourceConstraintComponent getConstraintComponent() {\n		return SourceConstraintComponent.HasValueConstraintComponent;\n	}\n\n	@Override\n	public ConstraintComponent deepClone() {\n		return new HasValueConstraintComponent(hasValue);\n	}\n\n	@Override\n	public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connectionsGroup,\n			ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, Scope scope) {\n\n		StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider = "
<!-- gh-comment-id:1694412020 --> @hmottestad commented on GitHub (Aug 26, 2023): Here is an example: ``` ollama run phind-codellama " Finished the method marked as TODO in the following Java code:\n\n\npackage org.eclipse.rdf4j.sail.shacl.ast.constraintcomponents;\n\nimport java.util.Collections;\nimport java.util.HashSet;\nimport java.util.List;\nimport java.util.Set;\n\nimport org.eclipse.rdf4j.model.IRI;\nimport org.eclipse.rdf4j.model.Literal;\nimport org.eclipse.rdf4j.model.Model;\nimport org.eclipse.rdf4j.model.Resource;\nimport org.eclipse.rdf4j.model.Value;\nimport org.eclipse.rdf4j.model.vocabulary.SHACL;\nimport org.eclipse.rdf4j.sail.shacl.SourceConstraintComponent;\nimport org.eclipse.rdf4j.sail.shacl.ValidationSettings;\nimport org.eclipse.rdf4j.sail.shacl.ast.SparqlFragment;\nimport org.eclipse.rdf4j.sail.shacl.ast.StatementMatcher;\nimport org.eclipse.rdf4j.sail.shacl.ast.StatementMatcher.Variable;\nimport org.eclipse.rdf4j.sail.shacl.ast.ValidationApproach;\nimport org.eclipse.rdf4j.sail.shacl.ast.ValidationQuery;\nimport org.eclipse.rdf4j.sail.shacl.ast.paths.Path;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.BulkedExternalLeftOuterJoin;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.EmptyNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.GroupByFilter;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.PlanNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.PlanNodeProvider;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ShiftToPropertyShape;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.TrimToTarget;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.UnBufferedPlanNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.UnionNode;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.Unique;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ValidationTuple;\nimport org.eclipse.rdf4j.sail.shacl.ast.planNodes.ValueInFilter;\nimport org.eclipse.rdf4j.sail.shacl.ast.targets.EffectiveTarget;\nimport org.eclipse.rdf4j.sail.shacl.wrapper.data.ConnectionsGroup;\nimport org.eclipse.rdf4j.sail.shacl.wrapper.data.RdfsSubClassOfReasoner;\n\npublic class HasValueConstraintComponent extends AbstractConstraintComponent {\n\n private final Value hasValue;\n\n public HasValueConstraintComponent(Value hasValue) {\n this.hasValue = hasValue;\n }\n\n @Override\n public void toModel(Resource subject, IRI predicate, Model model, Set<Resource> cycleDetection) {\n model.add(subject, SHACL.HAS_VALUE, hasValue);\n }\n\n @Override\n public SourceConstraintComponent getConstraintComponent() {\n return SourceConstraintComponent.HasValueConstraintComponent;\n }\n\n @Override\n public ConstraintComponent deepClone() {\n return new HasValueConstraintComponent(hasValue);\n }\n\n @Override\n public PlanNode generateTransactionalValidationPlan(ConnectionsGroup connectionsGroup,\n ValidationSettings validationSettings, PlanNodeProvider overrideTargetNode, Scope scope) {\n\n StatementMatcher.StableRandomVariableProvider stableRandomVariableProvider = " ```
Author
Owner

@matiasdominguez commented on GitHub (Aug 29, 2023):

I'm getting the same error without a long prompt, even a short hey will trigger the same Error: Post "http://localhost:11434/api/generate": EOF for me. Specs: 2021 M1 Pro / 32 GB RAM.

<!-- gh-comment-id:1696789018 --> @matiasdominguez commented on GitHub (Aug 29, 2023): I'm getting the same error without a long prompt, even a short `hey` will trigger the same `Error: Post "http://localhost:11434/api/generate": EOF` for me. Specs: 2021 M1 Pro / 32 GB RAM.
Author
Owner

@hmottestad commented on GitHub (Aug 29, 2023):

I'm getting the same error without a long prompt, even a short hey will trigger the same Error: Post "http://localhost:11434/api/generate": EOF for me. Specs: 2021 M1 Pro / 32 GB RAM.

If you installed Ollama through homebrew then you might have an old version. Have you tried with downloading the newest version directly from https://ollama.ai ?

<!-- gh-comment-id:1696882604 --> @hmottestad commented on GitHub (Aug 29, 2023): > I'm getting the same error without a long prompt, even a short `hey` will trigger the same `Error: Post "http://localhost:11434/api/generate": EOF` for me. Specs: 2021 M1 Pro / 32 GB RAM. If you installed Ollama through homebrew then you might have an old version. Have you tried with downloading the newest version directly from https://ollama.ai ?
Author
Owner

@matiasdominguez commented on GitHub (Aug 31, 2023):

Thanks @hmottestad. That actually fixed it, I thought the homebrew version was the latest one.

<!-- gh-comment-id:1700187945 --> @matiasdominguez commented on GitHub (Aug 31, 2023): Thanks @hmottestad. That actually fixed it, I thought the homebrew version was the latest one.
Author
Owner

@technovangelist commented on GitHub (Sep 1, 2023):

Sorry, we didn't create the homebrew package. It looks like its up to date, but maybe it doesn't automatically update like the one from the website does.

<!-- gh-comment-id:1702975342 --> @technovangelist commented on GitHub (Sep 1, 2023): Sorry, we didn't create the homebrew package. It looks like its up to date, but maybe it doesn't automatically update like the one from the website does.
Author
Owner

@hmottestad commented on GitHub (Sep 7, 2023):

This seems to be fixed in the latests v0.0.18 :)

<!-- gh-comment-id:1709716682 --> @hmottestad commented on GitHub (Sep 7, 2023): This seems to be fixed in the latests v0.0.18 :)
Author
Owner

@jmorganca commented on GitHub (Sep 7, 2023):

Fantastic. Closing this for now, but feel free to re-open if we see it again.

<!-- gh-comment-id:1709958371 --> @jmorganca commented on GitHub (Sep 7, 2023): Fantastic. Closing this for now, but feel free to re-open if we see it again.
Author
Owner

@heapframe commented on GitHub (Jan 9, 2024):

image
installer seems to give the same error

<!-- gh-comment-id:1883559616 --> @heapframe commented on GitHub (Jan 9, 2024): ![image](https://github.com/jmorganca/ollama/assets/63340001/f372eced-ac56-436b-adf6-048f45723fb2) installer seems to give the same error
Author
Owner

@gokulkumar3198 commented on GitHub (Jan 11, 2024):

I am also facing the same EOF error, could not figure out the problem. I have tried with the latest docker image as of today and v0.1.18 also.
Error: Post "http://0.0.0.0:11434/api/generate": EOF

<!-- gh-comment-id:1886985448 --> @gokulkumar3198 commented on GitHub (Jan 11, 2024): I am also facing the same EOF error, could not figure out the problem. I have tried with the latest docker image as of today and v0.1.18 also. **Error: Post "http://0.0.0.0:11434/api/generate": EOF**
Author
Owner

@nps798 commented on GitHub (Jan 16, 2024):

same problem here last week. Running ollama predefined model worked fine, but I faced issues when executing custom model (convert from makefile via -f command)

fortunately, I resolved it by relocating the origin makefile and GGUF file. Initially, the path containing these files was synced with my NAS which seemed to contribute to this EOF issue. Although I don't know the exact reason behind it, changing to another folder/path fixed the problem for me.

<!-- gh-comment-id:1893672990 --> @nps798 commented on GitHub (Jan 16, 2024): same problem here last week. Running ollama predefined model worked fine, but I faced issues when executing custom model (convert from makefile via -f command) fortunately, I resolved it by relocating the origin makefile and GGUF file. Initially, the path containing these files was synced with my NAS which seemed to contribute to this EOF issue. Although I don't know the exact reason behind it, changing to another folder/path fixed the problem for me.
Author
Owner

@fabianslife commented on GitHub (Jan 25, 2024):

Same problem here, giving it a prompt longer than two words immediately results in: Error: Post "http://127.0.0.1:11434/api/generate": EOF

<!-- gh-comment-id:1910705283 --> @fabianslife commented on GitHub (Jan 25, 2024): Same problem here, giving it a prompt longer than two words immediately results in: Error: Post "http://127.0.0.1:11434/api/generate": EOF
Author
Owner

@alexhegit commented on GitHub (Feb 5, 2024):

I go a problem like this one with log :

Error: Post "http://localhost:11434/api/chat": EOF

<!-- gh-comment-id:1926456172 --> @alexhegit commented on GitHub (Feb 5, 2024): I go a problem like this one with log : Error: Post "http://localhost:11434/api/chat": EOF
Author
Owner

@mehdiataei commented on GitHub (Feb 21, 2024):

Still happening

<!-- gh-comment-id:1957659006 --> @mehdiataei commented on GitHub (Feb 21, 2024): Still happening
Author
Owner

@AntDX316 commented on GitHub (Feb 21, 2024):

I have the issue on gemma:7b but mistral one works?

<!-- gh-comment-id:1958230081 --> @AntDX316 commented on GitHub (Feb 21, 2024): I have the issue on gemma:7b but mistral one works?
Author
Owner

@jafarzzz commented on GitHub (Feb 22, 2024):

Facing the same issue with gemma:7b. Other models are working fine. I updated the ollama. Still the problem persists.

<!-- gh-comment-id:1958868115 --> @jafarzzz commented on GitHub (Feb 22, 2024): Facing the same issue with gemma:7b. Other models are working fine. I updated the ollama. Still the problem persists.
Author
Owner

@serhanylmz commented on GitHub (Feb 22, 2024):

have the same issue with gemma:7b, can confirm

<!-- gh-comment-id:1958897542 --> @serhanylmz commented on GitHub (Feb 22, 2024): have the same issue with gemma:7b, can confirm
Author
Owner

@benjamin-bertram commented on GitHub (Feb 22, 2024):

Same here

<!-- gh-comment-id:1959087720 --> @benjamin-bertram commented on GitHub (Feb 22, 2024): Same here
Author
Owner

@jafarzzz commented on GitHub (Feb 22, 2024):

I fixed it by upgrading the ollama to 0.1.26. You wont be able to do it from the application. Uninstall the ollama and download the latest one from: https://ollama.com/

gemma:7b worked after this fix.

<!-- gh-comment-id:1959185554 --> @jafarzzz commented on GitHub (Feb 22, 2024): I fixed it by upgrading the ollama to 0.1.26. You wont be able to do it from the application. Uninstall the ollama and download the latest one from: https://ollama.com/ gemma:7b worked after this fix.
Author
Owner

@fithisux commented on GitHub (Feb 28, 2024):

In Windows 10PRO after calling

resp = gemma_2b.complete("Who is Paul Graham?")
print(resp)

I have the same error. In logs

[GIN] 2024/02/28 - 13:21:17 | 404 |         709µs |       127.0.0.1 | POST     "/api/generate"

System:

Edition Windows 10 Pro
Version 22H2
Installed on ‎19/‎1/‎2024
OS build 19045.4046
Experience Windows Feature Experience Pack 1000.19053.1000.0

<!-- gh-comment-id:1968776941 --> @fithisux commented on GitHub (Feb 28, 2024): In Windows 10PRO after calling ``` resp = gemma_2b.complete("Who is Paul Graham?") print(resp) ``` I have the same error. In logs ``` [GIN] 2024/02/28 - 13:21:17 | 404 | 709µs | 127.0.0.1 | POST "/api/generate" ``` System: Edition Windows 10 Pro Version 22H2 Installed on ‎19/‎1/‎2024 OS build 19045.4046 Experience Windows Feature Experience Pack 1000.19053.1000.0
Author
Owner

@BestMat commented on GitHub (Apr 22, 2024):

Same here, any solution for this problem?

<!-- gh-comment-id:2068888912 --> @BestMat commented on GitHub (Apr 22, 2024): Same here, any solution for this problem?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#62230