Urgent.News

What's breaking now, across thousands of outlets.

AI

How Your Message Actually Reaches the AI Model — And What You're Really Sending

You've used ChatGPT. You've used Gemini. You type something, it replies. But have you ever stopped and wondered — what is actually happening when you hit send? Because when you're building AI systems, that question matters. A lot. What happens when you type a message Let's take the simplest example. You open ChatGPT and type: "Explain what a token is in simple terms." You hit enter. A few seconds…

You have utilized AI systems like ChatGPT and Gemini. Typing a message triggers a process where your message travels over the internet to a powerful server, where it is processed and text is generated back to you. This is essentially a request and response cycle. The model resides on a server, hosted by the service provider. You connect to it via the internet using an API key provided by the provider. You pay per use of the model, with costs based on the number of tokens sent and received.

Alternatively, you can run a model locally on your own machine using tools like Ollama. This option allows you to run the model without internet connection, API key, or cost per call. However, smaller models are used, responses are slower, and your machine may generate more heat.

For individual users, local models are a good option for learning and privacy-sensitive use cases. However, cloud-hosted models are preferred for production and serious projects due to their performance and capabilities. To connect to a cloud-hosted model, you authenticate with an API key, which functions like a password. You create the key in the provider's dashboard, store it securely, and include it in every request.

Hardcoding the key in your code is not recommended, as it poses a significant security risk. Instead, store it in an environment variable and read it there.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in AI

More from Saturday 19 September →