Modelsmith
christo-olivier/modelsmith
Interface unificada para respostas estruturadas em múltiplos LLMs
Ver no GitHubBiblioteca Python que oferece uma interface unificada para obter respostas estruturadas em formato de modelos Pydantic e tipos Python a partir de APIs da Anthropic, Google Gemini e OpenAI. Inclui validação automática, retry configurável e suporte a templates Jinja2 para prompts complexos.
Instalação
npx convez-ai christo-olivier/modelsmith1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Extrair dados estruturados de respostas de LLMs
- Integrar Claude, GPT e Gemini com validação automática
- Construir pipelines de IA com tipos Python garantidos
Veredito

Solução prática e bem arquitetada para lidar com o problema real de estruturação de saídas de LLMs. A unificação de três provedores em uma API consistente agrega valor, embora o projeto tenha audiência mais técnica e nicho.
README
A tradução para o português deste README ainda está na fila.
Modelsmith
Modelsmith is a Python library that allows you to get structured responses in the form of Pydantic models and Python types from Anthropic, Google Gemini, and OpenAI models.
Currently it allows you to use the following classes of model:
- AnthropicModel (used with Anthropic's full set of models)
- OpenAIModel (used with OpenAI's full set of models)
- GeminiModel (used with Google's full set of Gemini models)
Modelsmith provides a unified interface over all of these. It has been designed to be extensible and can adapt to other models in the future.
Notable Features
- Structured Responses: Specify both Pydantic models and Python types as the outputs of your LLM responses.
- Templating: Use Jinja2 templating in your prompts to allow complex prompt logic.
- Default and Custom Prompts: A default prompt template is provided but you can also specify your own.
- Retry Logic: Number of retries is user configurable.
- Validation: Outputs from the LLM are validated against your requested response model. Errors are fed back to the LLM to try and correct any validation failures.
Installation
Install Modelsmith using pip or your favourite python package manager.
pip example:
pip install modelsmith
Documentation
For detailed documentation please have a look at https://christo-olivier.github.io/modelsmith
Get in touch
If you have any questions or suggestions, feel free to open an issue or start a discussion.
License
This project is licensed under the terms of the MIT License.