Switching a client between local and remote endpoints
Keep the JSON. Change the base URL.
A client that speaks one HTTP shape can move between machines by changing the base URL only. The messages, the model field, and the stream flag stay put. Local is usually http://127.0.0.1:11434 for Ollama or http://127.0.0.1:8000/v1 for an OpenAI-compatible server.
Remote, for this host, is the same path on datattention.com. Ollama-style stays on port 11434. OpenAI-style stays on port 8000 or 8080, with the /v1 prefix. Drop the API key when you point here. A key left over from a hosted provider is ignored, not required.
Write the base URL in one place in the client. A hard-coded localhost inside a library is the usual reason a switch appears to do nothing.
On this host
The remote side of the switch is below. The same JSON works against localhost if you have a compatible server there.
# local
curl http://127.0.0.1:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
# this host, no API key
curl http://datattention.com:8000/v1/chat/completions -H 'Content-Type: application/json' -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'
The full list of ports and paths is on the endpoints page.