Playing around with AI

· 4 min read

I’ve been spending my evenings and weekends playing around with AI. Not building the next big startup, just poking at things to see how they actually work under the hood. Two small projects came out of it.

OpenRouter is super cool

If you only take one thing from this post, try OpenRouter.

It’s a single API that sits in front of hundreds of models from different providers: OpenAI, Anthropic, Google, NVIDIA, Cohere and a long tail of smaller labs. You get one API key, and switching models is just changing a string:

client = OpenAI(base_url="https://openrouter.ai/api/v1", api_key=OPENROUTER_API_KEY)
client.chat.completions.create(model="poolside/laguna-s-2.1:free", messages=...)

The API is OpenAI-compatible, so any code or library that talks to OpenAI works with it out of the box. A few things I like:

  • Free models. There’s a rotating set of models you can use for free. They’re rate-limited, but more than enough for side projects.
  • Fallbacks. You can give it a list of models, and if the first one is busy it tries the next.
  • One bill. No juggling five accounts with five credit cards. And it accepts deposits in USDC, which as a crypto person I appreciate.

Langfuse for monitoring

The second tool is Langfuse. When an AI agent does something weird, you want to see exactly what it saw and did. Langfuse records every run as a trace: each model call with its messages and token counts, and each tool call with its arguments, output and errors, all nested in order.

It turned out to be the most useful part of my benchmark. When a model failed a task, I didn’t have to guess why. I opened the trace and read the model’s “thought process” step by step.

Building the agent bench

I wanted to know how well the free models on OpenRouter can actually act as a coding agent. Not chat, but read files, edit code and run tests on their own. So I built agent-bench.

The agent itself is surprisingly simple. It’s a loop:

  1. Send the conversation and a list of tools to the model.
  2. If the model asks to use a tool (read a file, write a file, edit a file, run a shell command), run it and send back the result.
  3. Repeat until the model answers without asking for a tool.

That’s it. That’s the whole “agent”.

The benchmark gives it 10 small programming tasks: fix a bug, add a CLI flag, split a module, write tests, rename a function everywhere, and so on. Each task has a hidden grader script the agent never sees. Exit code 0 means pass. No judging by eye.

I tested three free models, 10 tasks, 2 trials each:

Model Passed
NVIDIA Nemotron 3 Super 18/20
Poolside Laguna S 2.1 17/20
Cohere North Mini Code 15/20

Nemotron was the most accurate but slow. Laguna was almost as good with about a quarter of the tokens, which makes it the real winner for me.

The interesting part was how they failed. In 7 of the 10 failures, the model ran its own quick check, saw it pass, and confidently reported success. The bug was always in what its check didn’t cover. One model “fixed” a CSV parser by hard-coding the column names with the leading spaces from the sample file. It worked on that file and nothing else. Very human, honestly :D.

What is RAG, and how I’m using it

Finally, I want to talk about RAG short for retrieval-augmented generation. An LLM only knows what it saw during training, so it can’t tell you about yesterday’s news or info from some files that it has not seen (like internal company data). RAG fixes that: before asking the model, you search your own fresh documents for the relevant parts and paste them into the prompt. The model answers from those, not from memory.

That’s what my second project, a crypto news RAG, does. It works in four steps:

  1. Chunk: split your documents into small pieces of a few hundred words.
  2. Embed: turn each chunk into a vector, a list of numbers that captures its meaning.
  3. Retrieve: find the chunks closest to the question and drop anything that isn’t similar enough.
  4. Generate: send the question and those chunks to an LLM, which answers from them.

The downside of RAG is that a request like “summarize the news” doesn’t work, since it’s a similarity search and the question needs a topic to match.

Wrapping up

None of this is rocket science, and that’s the point. With OpenRouter for models, Langfuse for visibility and a few hundred lines of Python, you can build and measure real AI tools over a weekend, for free. If you’ve been meaning to try AI, just start.

← All posts