Skip to content
Open
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
6 changes: 3 additions & 3 deletions backend/app/evaluation/evals.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(

llm_provider = llm_provider.lower()
if llm_provider == "openai":
self._llama_llm = OpenAI(model="gpt-4o")
self._llama_llm = OpenAI(model="gpt-4.1-2025-04-14")
elif llm_provider == "gemini":
self._llama_llm = Gemini(model="models/gemini-2.0-flash")
else:
Expand All @@ -86,7 +86,7 @@ def __init__(
self._metrics = {
"language": LanguageEvaluator(llm=self._llama_llm),
"toxicity": ToxicityEvaluator(llm=self._llama_llm),
"e2e_rag": E2ERagEvaluator(model="gpt-4o"),
"e2e_rag": E2ERagEvaluator(model="gpt-4.1-2025-04-14"),
}

def runeval_dataset(
Expand Down Expand Up @@ -162,7 +162,7 @@ def runeval_dataset(
pd.DataFrame(error_list).to_csv(error_file, index=False)

ragas_dataset = EvaluationDataset.from_list(ragas_list)
evaluator_llm = LangchainLLMWrapper(ChatOpenAI(model="gpt-4o"))
evaluator_llm = LangchainLLMWrapper(ChatOpenAI(model="gpt-4.1-2025-04-14"))
evaluator_embeddings = LangchainEmbeddingsWrapper(
OpenAIEmbeddings(model="text-embedding-3-large")
)
Expand Down
2 changes: 1 addition & 1 deletion backend/app/evaluation/evaluators/e2e_rag_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


class E2ERagEvaluator:
def __init__(self, model="gpt-4o", threshold=0.7) -> None:
def __init__(self, model="gpt-4.1-2025-04-14", threshold=0.7) -> None:
self._model = model
self._threshold = threshold

Expand Down
4 changes: 2 additions & 2 deletions backend/app/rag/llms/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class LLMProviderOption(BaseModel):
provider_display_name="OpenAI",
provider_description="The OpenAI API provides a simple interface for developers to create an intelligence layer in their applications, powered by OpenAI's state of the art models.",
provider_url="https://platform.openai.com",
default_llm_model="gpt-4o",
default_llm_model="gpt-4.1-2025-04-14",
llm_model_description="",
credentials_display_name="OpenAI API Key",
credentials_description="The API key of OpenAI, you can find it in https://platform.openai.com/api-keys",
Expand Down Expand Up @@ -154,7 +154,7 @@ class LLMProviderOption(BaseModel):
provider_display_name="Azure OpenAI",
provider_description="Azure OpenAI is a cloud-based AI service that provides access to OpenAI's advanced language models.",
provider_url="https://azure.microsoft.com/en-us/products/ai-services/openai-service",
default_llm_model="gpt-4o",
default_llm_model="gpt-4.1-2025-04-14",
llm_model_description="",
config_description="Refer to this document https://learn.microsoft.com/en-us/azure/ai-services/openai/quickstart to have more information about the Azure OpenAI API.",
default_config={
Expand Down
2 changes: 1 addition & 1 deletion backend/app/tasks/evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def evaluate_task(evaluation_task_item: EvaluationTaskItem):
logger.debug(f"Dataset {ragas_dataset.to_pandas().head()}")

evaluator_llm = LlamaIndexLLMWrapper(
OpenAI(model="gpt-4o", api_key=settings.EVALUATION_OPENAI_API_KEY)
OpenAI(model="gpt-4.1-2025-04-14", api_key=settings.EVALUATION_OPENAI_API_KEY)
)
evaluator_embeddings = LlamaIndexEmbeddingsWrapper(
OpenAIEmbedding(
Expand Down
2 changes: 1 addition & 1 deletion backend/dspy_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def save_decompose_query_program():
dspy_lm = dspy.LM(model="gpt-4o-mini", api_key=os.getenv("OPENAI_API_KEY"))
dspy_lm = dspy.LM(model="gpt-4.1-2025-04-14-mini", api_key=os.getenv("OPENAI_API_KEY"))
module = DecomposeQueryModule(dspy_lm)
module.save("dspy_compiled_program/decompose_query/program.json")

Expand Down
6 changes: 3 additions & 3 deletions backend/tests/test_llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def check_dspy_lm_extract_graph(lm: dspy.LM):
def test_openai():
llm = resolve_llm(
provider=LLMProvider.OPENAI,
model="gpt-4o-mini",
model="gpt-4.1-2025-04-14-mini",
config={},
credentials=os.getenv("OPENAI_API_KEY"),
)
Expand Down Expand Up @@ -152,11 +152,11 @@ def test_gemini():
def test_azure_ai():
llm = resolve_llm(
provider=LLMProvider.AZURE_OPENAI,
model="gpt-4o-mini",
model="gpt-4.1-2025-04-14-mini",
credentials=os.getenv("AZURE_AI_API_KEY"),
config={
"azure_endpoint": os.getenv("AZURE_AI_ENDPOINT"),
"engine": "gpt-4o",
"engine": "gpt-4.1-2025-04-14",
"api_version": "2025-01-01-preview",
},
)
Expand Down
2 changes: 1 addition & 1 deletion core/autoflow/configs/models/llms/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class BaseLLMConfig(BaseModel):
model: str = Field(
description="The model to use for the LLM",
default="gpt-4o",
default="gpt-4.1-2025-04-14",
)
max_tokens: Optional[int] = None
temperature: float = 0.1
2 changes: 1 addition & 1 deletion core/examples/quickstart/quickstart.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
"from autoflow.models.embedding_models import EmbeddingModel\n",
"from IPython.display import JSON\n",
"\n",
"llm = LLM(\"gpt-4o-mini\")\n",
"llm = LLM(\"gpt-4.1-2025-04-14-mini\")\n",
"embed_model = EmbeddingModel(\"text-embedding-3-small\")\n",
"\n",
"kb = af.create_knowledge_base(\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
st.stop()

af = Autoflow(create_engine(database_url))
chat_model = ChatModel("gpt-4o-mini", api_key=openai_api_key)
chat_model = ChatModel("gpt-4.1-2025-04-14-mini", api_key=openai_api_key)
embedding_model = EmbeddingModel(
model_name="text-embedding-3-small",
dimensions=1536,
Expand Down
2 changes: 1 addition & 1 deletion core/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def db_engine():

@pytest.fixture(scope="session")
def llm():
return LLM(model="openai/gpt-4o-mini")
return LLM(model="openai/gpt-4.1-2025-04-14-mini")


@pytest.fixture(scope="session")
Expand Down
2 changes: 1 addition & 1 deletion core/tests/models/test_model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_llm():
llm = model_manager.resolve_llm(
provider=ModelProviders.OPENAI,
config={
"model": "gpt-4o",
"model": "gpt-4.1-2025-04-14",
},
)

Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export function FAQBox({ title, children }) {
AutoFlow uses LLM to extract knowledge graph from docs and generate responses to user queries, so the LLM is the core of this RAG app, the Smarter LLM, the better the performance.
Currently the online demo(https://tidb.ai) is using OpenAI as chat model by default, and the following LLMs are supported/tested by this RAG app:

- [gpt-4/gpt-4o/gpt-4o-mini/o1/o1-mini](https://platform.openai.com/docs/models)
- [gpt-4/gpt-4.1-2025-04-14/gpt-4.1-2025-04-14-mini/o1/o1-mini](https://platform.openai.com/docs/models)
- [gemini-1.5-pro/gemini-2.0-flash](https://gemini.google.com/)
- [claude-3.5-sonnet](https://claude.ai/)
- [glm-4-plus](https://bigmodel.cn/)
Expand Down
Loading