Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected non-whitespace character after JSON at position 4 #73

Closed
netsrujana opened this issue Dec 7, 2024 · 1 comment

Comments

@netsrujana
Copy link

netsrujana commented Dec 7, 2024

I am accessing ollama running on a different machine via ngork. I am having the following error.

API https://xxxxx..ngrok-free.app/api/chat/completions is resulting in 404 error.

Error: API Error: https://xxxxx..ngrok-free.app/api/chat/completions, SyntaxError: Unexpected non-whitespace character after JSON at position 4
Request Body: {
"model": "llama3.2",
"messages": [
{
"role": "system",
"content": "Given the fields Text To Summarize, produce the fields Reason, Short Summary."
},
{
"role": "user",
"content": "Use the following key-value output format for the output not JSON or a markdown block.\n\nReason: Let's work this out in a step by step way in order to ensure we have the right answer.\n\nShort Summary: summarize in 5 to 10 words\n\n---\n\n\nText To Summarize: \n The technological singularity—or simply the singularity[1]—is a hypothetical\n future point in time at which technological growth becomes uncontrollable\n and irreversible, resulting in unforeseeable changes to human\n civilization.[2][3] ...\n\n"
}
],
"max_tokens": 2000,
"temperature": 0,
"top_p": 1,
"frequency_penalty": 0.2
}

@nicholasq
Copy link

nicholasq commented Dec 21, 2024

I'm running into the same issue. The problem is that ax makes a call to /api/chat/completions which does not exist on ollama api. At least not on the most recent version of ollama (0.5.4). The Ollama docs show that the actual path for chat is /api/chat. However, there is a 'compatibility endpoint' at /v1/chat/completions shown here

@dosco dosco closed this as completed in 2e63e33 Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants