Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# Supported values:
# nebius | openai | anthropic | groq | ollama | together | fireworks |
# mistralai | google
# mistralai | google | minimax
#
LLM_PROVIDER=nebius

Expand All @@ -23,6 +23,7 @@ LLM_PROVIDER=nebius
# ollama → llama3.1:8b
# together → meta-llama/Llama-3.3-70B-Instruct-Turbo
# google → gemini-2.0-flash
# minimax → MiniMax-M3
LLM_MODEL=meta-llama/Llama-3.3-70B-Instruct

# Default sampling temperature (architectures override per-node when needed).
Expand All @@ -39,6 +40,8 @@ TOGETHER_API_KEY=
FIREWORKS_API_KEY=
MISTRAL_API_KEY=
GOOGLE_API_KEY=
MINIMAX_API_KEY=
MINIMAX_BASE_URL=https://api.minimax.io/v1

# Ollama runs locally; no key needed. Override the host if not on default port.
OLLAMA_BASE_URL=http://localhost:11434
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ leaderboard that ranks every architecture against every relevant task.
<td align="center" width="140"><h2><kbd>&nbsp; 35 &nbsp;</kbd></h2><sub>ARCHITECTURES</sub></td>
<td align="center" width="140"><h2><kbd>&nbsp; 283 &nbsp;</kbd></h2><sub>PASSING TESTS</sub></td>
<td align="center" width="140"><h2><kbd>&nbsp; 17 &nbsp;</kbd></h2><sub>BENCHMARK TASKS</sub></td>
<td align="center" width="140"><h2><kbd>&nbsp; 9 &nbsp;</kbd></h2><sub>LLM PROVIDERS</sub></td>
<td align="center" width="140"><h2><kbd>&nbsp; 10 &nbsp;</kbd></h2><sub>LLM PROVIDERS</sub></td>
<td align="center" width="140"><h2><kbd>&nbsp; 0 &nbsp;</kbd></h2><sub>MOCKED RUNS</sub></td>
</tr>
</table>
Expand All @@ -55,7 +55,7 @@ leaderboard that ranks every architecture against every relevant task.

## Overview

A single Python library that packages every major agentic AI pattern from the literature as a runnable `Architecture` class with a uniform contract. Each pattern ships with a fully executed Jupyter notebook whose theory is written *against* the captured run — not synthetic examples. The library is multi-provider (Nebius, OpenAI, Anthropic, Groq, Ollama, Together, Fireworks, Mistral, Google) and built on top of LangGraph state machines.
A single Python library that packages every major agentic AI pattern from the literature as a runnable `Architecture` class with a uniform contract. Each pattern ships with a fully executed Jupyter notebook whose theory is written *against* the captured run — not synthetic examples. The library is multi-provider (Nebius, OpenAI, Anthropic, Groq, Ollama, Together, Fireworks, Mistral, Google, MiniMax) and built on top of LangGraph state machines.

The central technical discipline of the repository is the **deterministic-picker pattern** — every LLM-as-Scorer surface has the LLM commit to categorical features (booleans, enums) and lets Python compose the deciding signal. This is the universal escape from the LLM-as-Scorer flat-band pathology, applied in 13 of 35 architectures; 9 more are architecturally immune by design.

Expand Down Expand Up @@ -296,6 +296,7 @@ Patterns that appear across families.
<tr><td>Fireworks</td><td><code>[fireworks]</code></td><td>Function-calling first-class</td></tr>
<tr><td>Mistral</td><td><code>[mistral]</code></td><td>EU-hosted option</td></tr>
<tr><td>Google</td><td><code>[google]</code></td><td>Gemini 2.x via Generative AI API</td></tr>
<tr><td>MiniMax</td><td><code>[openai]</code></td><td>OpenAI-compatible MiniMax-M3 with a 1M-token context window</td></tr>
</table>

Switch via `LLM_PROVIDER` + the corresponding key in `.env`. No code changes.
Expand Down
6 changes: 4 additions & 2 deletions docs/getting-started/providers.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Switching LLM providers

Every architecture in this library is provider-agnostic. The same `Reflection` class works against Nebius Llama, OpenAI GPT-4o, Anthropic Claude, Groq, Ollama, Together, Fireworks, Mistral, or Google Gemini — you change one config setting.
Every architecture in this library is provider-agnostic. The same `Reflection` class works against Nebius Llama, OpenAI GPT-4o, Anthropic Claude, Groq, Ollama, Together, Fireworks, Mistral, Google Gemini, or MiniMax — you change one config setting.

## The `get_llm()` factory

Expand All @@ -13,6 +13,7 @@ llm = get_llm()
# Override per-call
llm = get_llm(provider="openai", model="gpt-4o-mini", temperature=0.4)
llm = get_llm(provider="anthropic", model="claude-haiku-4-5-20251001")
llm = get_llm(provider="minimax", model="MiniMax-M3")
llm = get_llm(provider="ollama", model="llama3.3:70b")
```

Expand All @@ -36,6 +37,7 @@ arch = Reflection(llm=llm)
| **Fireworks** | `[fireworks]` | `FIREWORKS_API_KEY` | Function-calling first-class. |
| **Mistral** | `[mistral]` | `MISTRAL_API_KEY` | EU-hosted option. |
| **Google** | `[google]` | `GOOGLE_API_KEY` | Gemini-2.x via Generative AI API. |
| **MiniMax** | `[openai]` | `MINIMAX_API_KEY` | OpenAI-compatible API with MiniMax-M3 and a 1M-token context window. |

## Environment configuration

Expand All @@ -53,7 +55,7 @@ LANGSMITH_API_KEY=ls-... # optional, for tracing
LANGSMITH_PROJECT=all-agentic-architectures
```

To switch globally, change `LLM_PROVIDER` + the corresponding key. No code changes needed.
To switch globally, change `LLM_PROVIDER` + the corresponding key. No code changes needed. For MiniMax's China endpoint, also set `MINIMAX_BASE_URL=https://api.minimaxi.com/v1`.

## When you'd override per-architecture

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ requires-python = ">=3.10"
keywords = [
"agents", "agentic", "llm", "langchain", "langgraph", "langsmith",
"rag", "reflexion", "react", "tree-of-thoughts", "lats", "graphrag",
"multi-agent", "ai", "openai", "anthropic", "nebius",
"multi-agent", "ai", "openai", "anthropic", "nebius", "minimax",
]
authors = [{ name = "Fareed Khan", email = "fareedhassankhan12@gmail.com" }]
classifiers = [
Expand Down
4 changes: 4 additions & 0 deletions src/agentic_architectures/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _locate_env_file() -> str:
"fireworks",
"mistralai",
"google",
"minimax",
"huggingface",
]

Expand All @@ -60,6 +61,8 @@ class Settings(BaseSettings):
fireworks_api_key: SecretStr | None = None
mistral_api_key: SecretStr | None = None
google_api_key: SecretStr | None = None
minimax_api_key: SecretStr | None = None
minimax_base_url: str = "https://api.minimax.io/v1"
huggingfacehub_api_token: SecretStr | None = None
ollama_base_url: str = "http://localhost:11434"

Expand Down Expand Up @@ -110,6 +113,7 @@ def api_key_for(self, provider: Provider) -> SecretStr | None:
"fireworks": self.fireworks_api_key,
"mistralai": self.mistral_api_key,
"google": self.google_api_key,
"minimax": self.minimax_api_key,
"huggingface": self.huggingfacehub_api_token,
"ollama": None, # local, no key
}.get(provider)
Expand Down
14 changes: 14 additions & 0 deletions src/agentic_architectures/llm/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"fireworks": {"tools": True, "structured_output": True},
"mistralai": {"tools": True, "structured_output": True},
"google": {"tools": True, "structured_output": True},
"minimax": {"tools": True, "structured_output": True},
"ollama": {"tools": True, "structured_output": False},
"huggingface": {"tools": False, "structured_output": False},
}
Expand Down Expand Up @@ -75,6 +76,19 @@ def get_llm(
**kwargs,
)

if provider == "minimax":
try:
from langchain_openai import ChatOpenAI
except ImportError as e:
raise ImportError("MiniMax provider requires `pip install agentic-architectures[openai]`") from e
return ChatOpenAI(
model=model,
temperature=temperature,
api_key=api_key,
base_url=settings.minimax_base_url,
**kwargs,
)

# All other providers go through langchain's init_chat_model.
try:
from langchain.chat_models import init_chat_model
Expand Down
8 changes: 8 additions & 0 deletions src/agentic_architectures/llm/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,12 @@ class ProviderInfo:
docs_url="https://ai.google.dev/gemini-api/docs",
recommended_model="gemini-2.0-flash",
),
"minimax": ProviderInfo(
id="minimax",
name="MiniMax",
signup_url="https://platform.minimax.io",
docs_url="https://platform.minimax.io/docs/api-reference/api-overview",
recommended_model="MiniMax-M3",
notes="OpenAI-compatible API with a 1M-token context window.",
),
}