Are you just using it like a chatbot in this situation?
For short snippets, I usually just paste the code in (e.g. using triple backticks to indicate a codeblock with Markdown if I want distinguish it clearly from other text in my prompt). It's also possible to drag-and-drop files into the web UI that ships with llama-server, and I also have some of my own custom tooling.
How are you giving it things like binary files? Does it actually understand them? Is that a feature of only certain models?
Vision Language Models can work with images. Both Qwen and Gemma can do it. In the web UI, you can just drag and drop images in and they'll be added as attachments that get processed along with your prompt text. There's limits to what they can understand -- I recommend experimenting with them to get a sense of it -- but for things like OCR, they just do it...
I've also implemented handling for passing images into models via code if you're curious about that as well -- basically you just add the file as base64 encoded data in the JSON structure that you POST to the server.
llama-server's web UI can process PDFs too, but I'm not sure on what it does for that exactly under the hood.