Skip to main content
Inferix
← All courses Intermediate

Agents Course

Build tool-using agents with robust evaluation.

1

What is an agent?

The reason–act loop: an LLM that plans, calls tools, observes results, and iterates to a goal.

Try it on Inferix

Feel the difference between a model that answers and an agent that acts.

  1. In the Playground, ask: "What is 4871 × 2293?" Note the answer.
  2. Ask again, this time: "Work it out step by step, showing each partial product, then state the total."
  3. Check both against a calculator.
  4. Now consider what a tool would change: an agent would not compute it at all, it would call a calculator and report the result.

What you should see: Step-by-step is usually closer, but neither is reliable. That unreliability is the entire argument for tools — you give the model an escape from doing what it is bad at.

2

Code agents with smolagents

Agents that write Python actions instead of JSON — more reliable and token-efficient. Define tools and pick a model.

Try it on Inferix

Understand why writing code beats emitting JSON for multi-step work.

  1. Read the smolagents docs and find the CodeAgent example.
  2. Take a two-step task — fetch a list, then filter it — and write out the JSON tool calls it would need. Note that step two cannot be written until step one has returned.
  3. Now write the same thing as three lines of Python. Both steps fit in one action.
  4. That is the saving: one model round-trip instead of two, and the intermediate value never has to be serialised into the context.

What you should see: The gap widens with every extra step. At five steps a JSON agent has made five round-trips and carried every intermediate result through its context window.

3

Tools and MCP

Wrap any function as a tool, or connect an MCP server to expose a whole toolset to your agent.

Try it on Inferix

Give a local agent the ability to search Inferix.

  1. Open the MCP page and read the five tools the server exposes. They are all read-only — the server cannot change anything in your account.
  2. Copy the config block into your MCP client (claude_desktop_config.json for Claude Desktop) and restart it.
  3. Ask your client for "a small multilingual embedding model on Inferix". It should call inferix_search_models rather than guessing from memory.
  4. Ask it to cost a training run. That should reach inferix_search_gpus and inferix_market_metrics.

What you should see: The agent looks things up instead of hallucinating model names. Read-only calls work without a token; a token only adds your private repos.

4

Secure execution

Run agent-generated code safely with a restricted interpreter or a Docker/E2B sandbox.

Try it on Inferix

Establish what an agent could do to you before you let it run code.

  1. Write down what the agent's process can currently reach: the filesystem it runs as, network egress, and any credentials in its environment.
  2. Ask an agent to write a file to disk. If it succeeds, that is your blast radius.
  3. Pick a boundary — a restricted interpreter with an allowlist of imports, or a container with no credentials mounted.
  4. Re-run the same request and confirm it now fails.

What you should see: A failing write is the point. An agent that cannot be stopped from touching the host is not sandboxed, however well it happens to behave in testing.

5

Evaluating agents

Trace every step, score task success, and iterate. Compare agent models on the leaderboard.

Try it on Inferix

Score an agent on task completion rather than on whether the answer reads well.

  1. Pick five tasks with a checkable end state — a file exists, a number matches, a query returns rows.
  2. Run each and log every step the agent took, not just the final output.
  3. Score pass/fail on the end state alone. Ignore how convincing the explanation was.
  4. For the failures, find the first step that went wrong. That is where to intervene.

What you should see: Most failures trace to one bad early step that everything after it inherited. Fixing the last step before the answer is almost always the wrong repair.

    We use cookies for essential functionality and analytics. You can accept or reject analytics cookies.Cookie policy