# AI Architectures Supported by AI Berkshire: A Complete Guide

> Discover AI Berkshire's support for OpenAI GPT, Claude, Gemini, DeepSeek & custom LLMs. Explore compatible AI architectures with this comprehensive guide from xbtlin/ai-berkshire.

- Repository: [Xbt Lin/ai-berkshire](https://github.com/xbtlin/ai-berkshire)
- Tags: how-to-guide
- Published: 2026-07-09

---

**AI Berkshire supports OpenAI GPT, Anthropic Claude, Google Gemini, DeepSeek, and any custom OpenAI-compatible LLM through a unified model adapter layer.**

The **xbtlin/ai-berkshire** repository is a modular research automation platform designed to analyze financial data and generate investment reports. Understanding which **AI architectures are supported by AI Berkshire** is essential for configuring the right model provider for your specific analysis pipeline, from earnings call summarization to valuation report generation.

## Supported AI Architectures

AI Berkshire treats the model layer as interchangeable infrastructure. You can run identical workflows across different LLM families by changing a single configuration parameter in [`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py).

### OpenAI GPT Models

The platform natively integrates with **OpenAI's GPT family**, including GPT-4, GPT-4o, and GPT-3.5-Turbo. These models are the default for many report-generation scripts due to their robust instruction following and long context windows.

### Anthropic Claude

**Anthropic Claude** models (Claude-2, Claude-Instant) are fully supported through the same adapter interface. The codebase references these models in internal notebooks for tasks requiring high reasoning fidelity and extended context processing.

### Google Gemini

**Google Gemini** architectures—including Gemini 1.5 and Gemini Pro—are integrated for analysts preferring Google's ecosystem. Real-world usage is documented in `reports/段永平/段永平雪球全量原发言.md`, where analysts reference Gemini for specific financial reasoning tasks alongside other providers.

### DeepSeek

**DeepSeek** models (DeepSeek Chat, DeepSeek Coder) are supported and actively used in specialized research reports. The file `reports/海尔智家-deepseek分析/README.md` demonstrates production usage of DeepSeek architectures for deep financial analysis and company valuation.

### Custom Open-Source LLMs

Any self-hosted model implementing an **OpenAI-compatible API** can be integrated. This includes local deployments of LLaMA, Mistral, or other community models, allowing you to run AI Berkshire entirely offline or on private infrastructure.

## How the Model Adapter Layer Works

In [`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py), the `LLMClient` class abstracts provider-specific details behind a unified interface. This "Model Adapter" layer translates generic "prompt + context" calls into the specific API format of the selected provider.

The architecture diagram in `assets/architecture.svg` illustrates this design: a thin abstraction layer sits between the data ingestion/report generation code and the underlying LLM endpoints. This separation allows you to swap models without rewriting data validation, financial rigor checks, or output formatting logic.

## Code Examples

Below are runnable Python snippets demonstrating how to invoke different architectures through AI Berkshire's helper functions.

### Switching Between OpenAI and Anthropic

```python
from tools.llm_helper import LLMClient

# Use OpenAI GPT-4

openai_client = LLMClient(provider="openai", model="gpt-4")
response = openai_client.complete(
    prompt="Summarize the latest earnings call for Nvidia."
)

# Switch to Anthropic Claude-2

anthropic_client = LLMClient(provider="anthropic", model="claude-2")
response = anthropic_client.complete(
    prompt="Summarize the latest earnings call for Nvidia."
)

```

### Using a Self-Hosted Custom Model

```python

# Example: Using a custom Open-Source model via the OpenAI-compatible endpoint

custom_client = LLMClient(
    provider="openai",                     # uses same wrapper

    api_base="http://localhost:8000/v1",   # your self-hosted server

    model="llama-2-13b"
)
response = custom_client.complete(
    prompt="Generate a valuation summary for Alibaba."
)

```

These examples illustrate the **plug-and-play** nature of AI Berkshire's model layer—simply change the `provider` and `model` arguments while the surrounding pipeline remains unchanged.

## Key Implementation Files

- **[`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py)** — Central wrapper that normalizes OpenAI, Anthropic, Google, and custom endpoints.
- **[`README.md`](https://github.com/xbtlin/ai-berkshire/blob/main/README.md)** and **[`README_EN.md`](https://github.com/xbtlin/ai-berkshire/blob/main/README_EN.md)** — High-level project overview and architecture diagrams.
- **`assets/architecture.svg`** — Visual representation of the interchangeable model layer.
- **`reports/段永平/段永平雪球全量原发言.md`** — Real-world example showing analysts referencing multiple LLMs (Gemini, GPT).
- **`reports/海尔智家-deepseek分析/README.md`** — Demonstrates DeepSeek model integration for financial analysis.

## Summary

- AI Berkshire supports **OpenAI GPT**, **Anthropic Claude**, **Google Gemini**, **DeepSeek**, and **custom OpenAI-compatible LLMs**.
- The **`LLMClient`** class in [`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py) provides a unified interface for all providers.
- You can switch architectures by changing the `provider` and `model` parameters without modifying downstream data processing code.
- The platform is designed to work with both cloud APIs and self-hosted models via OpenAI-compatible endpoints.

## Frequently Asked Questions

### What AI architectures are supported by AI Berkshire?

AI Berkshire supports OpenAI GPT (GPT-4, GPT-4o), Anthropic Claude (Claude-2), Google Gemini (1.5, Pro), DeepSeek (Chat, Coder), and any custom LLM implementing an OpenAI-compatible API. This multi-architecture support is implemented through the `LLMClient` abstraction layer in [`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py).

### How do I switch between different LLM providers in the codebase?

Switch providers by instantiating `LLMClient` with different arguments. Set `provider="openai"`, `provider="anthropic"`, or `provider="google"` (depending on implementation), and specify the model name. The rest of your research pipeline—including data ingestion and report generation—remains identical regardless of which architecture you select.

### Can I use self-hosted or local models with AI Berkshire?

Yes. Any model exposing an OpenAI-compatible REST API can be integrated by setting `provider="openai"` and pointing `api_base` to your local server endpoint (e.g., `http://localhost:8000/v1`). This allows you to use open-source models like LLaMA or Mistral running on private infrastructure.

### Which file contains the model abstraction logic?

The core abstraction logic resides in **[`tools/llm_helper.py`](https://github.com/xbtlin/ai-berkshire/blob/main/tools/llm_helper.py)**. This file defines the `LLMClient` class that normalizes API calls across different AI architectures, handling provider-specific authentication, request formatting, and response parsing behind a unified interface.