you can do both! all of our models are supported either via workers / pages binding (which makes it really easy to host the rest of the logic), and via REST API
docs: https://developers.cloudflare.com/workers-ai/get-started/res...
(llama specific example here too under curl: https://developers.cloudflare.com/workers-ai/models/llm/ )