Repolode
kennethreitz

kennethreitz/simplemind

Python client library that wraps multiple AI provider APIs behind one simple interface for text, structured data, and conversations.

Stars
538
Forks
33
Open issues
8
Last commit
8 days ago

What is it?

Simplemind is a Python library for calling large language model APIs. It offers one consistent set of functions, such as generate_text, generate_data, and create_conversation, that work the same way across providers including Anthropic, OpenAI, Google Gemini, xAI, Groq, DeepSeek, Ollama, Amazon Bedrock, and MiniMax. Switching models is a matter of changing the llm_provider and llm_model arguments.

Beyond plain text generation, the library can return responses as Pydantic models when the chosen model supports structured output, and it supports streaming. Conversations keep message history and can be extended with plugins that run hooks before each send. Tools let models call ordinary Python functions, and a decorator can generate tool schemas automatically using an LLM.

The project positions itself as a lighter alternative to frameworks such as LangChain and LangGraph for common use cases. Session objects let you set default provider and model settings once and override them per call.

Key features

  • 01Single API surface for Anthropic, OpenAI, Gemini, xAI, Groq, DeepSeek, Ollama, Bedrock and MiniMax
  • 02Structured output into Pydantic models via generate_data
  • 03Streaming text generation
  • 04Multi-turn conversations with message history and plugin hooks
  • 05Function calling with Python functions, plus LLM-generated tool schemas via a decorator

Use cases

  • Prototyping an app that needs to compare or switch between several LLM providers
  • Extracting structured data from text into typed Python objects
  • Building a chatbot or assistant that calls your own Python functions as tools
  • Replacing a heavier LangChain-based setup for simple LLM calls

Quick start

  1. 1

    Install the library with its full extras

    pip install 'simplemind[full]'
  2. 2

    Set your provider API key as an environment variable

    export OPENAI_API_KEY="sk-..."
  3. 3

    Import Simplemind and start calling it

Things to know

  • Most providers require an API key, and many are paid services.

In collections

Topics

FAQ

What is simplemind?
Python client library that wraps multiple AI provider APIs behind one simple interface for text, structured data, and conversations. Simplemind is a Python library for calling large language model APIs. It offers one consistent set of functions, such as generate_text, generate_data, and create_conversation, that work the same way across providers including Anthropic, OpenAI, Google Gemini, xAI, Groq, DeepSeek, Ollama, Amazon Bedrock, and MiniMax. Switching models is a matter of changing the llm_provider and llm_model arguments.
Is simplemind free to use? What license does it have?
simplemind is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is simplemind still maintained?
Actively maintained. The last commit to simplemind was on Oct 30, 2026.
What can I use simplemind for?
Prototyping an app that needs to compare or switch between several LLM providers Extracting structured data from text into typed Python objects Building a chatbot or assistant that calls your own Python functions as tools Replacing a heavier LangChain-based setup for simple LLM calls
How do I install simplemind?
Install the library with its full extras: pip install 'simplemind[full]' Set your provider API key as an environment variable: export OPENAI_API_KEY="sk-..." Import Simplemind and start calling it
Where can I get simplemind?
The source code and installation instructions are on GitHub: https://github.com/kennethreitz/simplemind

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects