ptoloudis commited on
Commit
ee0a78f
·
verified ·
1 Parent(s): b3e303c

Upload 5 files

Browse files
Files changed (2) hide show
  1. README.md +19 -15
  2. agent.py +9 -7
README.md CHANGED
@@ -35,22 +35,26 @@ itself.
35
 
36
  To run it (locally or as a Space), set the `HF_TOKEN` secret/env var to a
37
  Hugging Face access token with Inference API permission. Optionally set
38
- `HF_AGENT_MODEL` to override the default model
39
- (`meta-llama/Llama-3.1-8B-Instruct`), and `HF_AGENT_PROVIDER` to override the
40
- default Inference Provider (`deepinfra`) — pinned explicitly because the
41
- router's `auto` selection can land on a provider that doesn't support tool
42
- calling for a given model (HTTP 422 `UNSUPPORTED_OPENAI_PARAMS`), and not every
43
- provider hosts every model (HTTP 4xx "Model ... is not supported by provider
44
- ..."). Check `https://router.huggingface.co/v1/models/<repo_id>` to see which
45
- providers host a given model and whether they support tools before changing
46
- either variable.
47
 
48
- The default 8B model was chosen for cost, not accuracy: the HF free tier only
49
- includes $0.10/month of Inference Provider credits, and a 70B model burns
50
- through that almost instantly across a full GAIA run. If you have more budget
51
- (pre-paid credits or PRO), switch to a larger model such as
52
- `meta-llama/Llama-3.3-70B-Instruct` on the `together` provider for more
53
- reliable reasoning on harder questions.
 
 
 
 
54
 
55
  ### Using Claude instead
56
 
 
35
 
36
  To run it (locally or as a Space), set the `HF_TOKEN` secret/env var to a
37
  Hugging Face access token with Inference API permission. Optionally set
38
+ `HF_AGENT_MODEL` to override the default model (`Qwen/Qwen3-14B`), and
39
+ `HF_AGENT_PROVIDER` to override the default Inference Provider (`nscale`) —
40
+ pinned explicitly because the router's `auto` selection can land on a
41
+ provider that doesn't support tool calling for a given model (HTTP 422
42
+ `UNSUPPORTED_OPENAI_PARAMS`), and not every provider hosts every model (HTTP
43
+ 4xx "Model ... is not supported by provider ..."). Check
44
+ `https://router.huggingface.co/v1/models/<repo_id>` to see which providers
45
+ host a given model and whether they support tools before changing either
46
+ variable.
47
 
48
+ The default model is a budget pick, not a maximal-accuracy one: the HF free
49
+ tier only includes $0.10/month of Inference Provider credits, and a 70B+
50
+ model burns through that in a couple of questions. `Qwen/Qwen3-14B` on
51
+ `nscale` costs only a few cents for a full ~20-question GAIA run while
52
+ reasoning noticeably better than the 8B model it replaced. For an even
53
+ smaller footprint (more runs per month out of the free allowance), set
54
+ `HF_AGENT_MODEL=meta-llama/Llama-3.1-8B-Instruct` and
55
+ `HF_AGENT_PROVIDER=deepinfra`. If you have real budget (pre-paid credits or
56
+ PRO), go bigger with something like `meta-llama/Llama-3.3-70B-Instruct` on
57
+ `together` for more reliable reasoning on harder questions.
58
 
59
  ### Using Claude instead
60
 
agent.py CHANGED
@@ -34,18 +34,20 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
34
  LLM_PROVIDER = os.getenv("LLM_PROVIDER", "huggingface")
35
 
36
  # Any HF Inference API model that supports tool calling works here. Override via the
37
- # HF_AGENT_MODEL env var without touching code. Llama-3.1-8B-Instruct is ~15x cheaper per
38
- # token than the 70B default it replaced - picked to fit the free tier's tiny $0.10/month
39
- # Inference Provider credit allowance; swap to a larger model (e.g.
40
- # meta-llama/Llama-3.3-70B-Instruct on the "together" provider) once you have more budget
41
- # for better reasoning on harder GAIA questions.
42
- HF_MODEL_REPO_ID = os.getenv("HF_AGENT_MODEL", "meta-llama/Llama-3.1-8B-Instruct")
 
 
43
 
44
  # Left unset ("auto"), the HF router picks whichever provider is cheapest/fastest for the
45
  # model, and some of those don't support the `tools` param at all (HTTP 422
46
  # UNSUPPORTED_OPENAI_PARAMS). Pin one that reliably supports tool calling; override via
47
  # HF_AGENT_PROVIDER if it doesn't happen to host HF_AGENT_MODEL.
48
- HF_MODEL_PROVIDER = os.getenv("HF_AGENT_PROVIDER", "deepinfra")
49
 
50
  # Cheapest current Claude model - a good fit for an agent that makes many tool-calling
51
  # round trips per question. Override via ANTHROPIC_MODEL (e.g. "claude-sonnet-5" for
 
34
  LLM_PROVIDER = os.getenv("LLM_PROVIDER", "huggingface")
35
 
36
  # Any HF Inference API model that supports tool calling works here. Override via the
37
+ # HF_AGENT_MODEL env var without touching code. Qwen3-14B gives noticeably better reasoning
38
+ # than the 8B model it replaced (meta-llama/Llama-3.1-8B-Instruct) for a modest bite out of
39
+ # the free tier's tiny $0.10/month Inference Provider credit allowance - on the "nscale"
40
+ # provider below, a full ~20-question GAIA run costs only a few cents. Drop back to
41
+ # Llama-3.1-8B-Instruct (paired with the "deepinfra" provider) if you need more runs per
42
+ # month out of the free allowance, or go bigger (e.g. meta-llama/Llama-3.3-70B-Instruct on
43
+ # "together") once you have paid credits.
44
+ HF_MODEL_REPO_ID = os.getenv("HF_AGENT_MODEL", "Qwen/Qwen3-14B")
45
 
46
  # Left unset ("auto"), the HF router picks whichever provider is cheapest/fastest for the
47
  # model, and some of those don't support the `tools` param at all (HTTP 422
48
  # UNSUPPORTED_OPENAI_PARAMS). Pin one that reliably supports tool calling; override via
49
  # HF_AGENT_PROVIDER if it doesn't happen to host HF_AGENT_MODEL.
50
+ HF_MODEL_PROVIDER = os.getenv("HF_AGENT_PROVIDER", "nscale")
51
 
52
  # Cheapest current Claude model - a good fit for an agent that makes many tool-calling
53
  # round trips per question. Override via ANTHROPIC_MODEL (e.g. "claude-sonnet-5" for