8 GPT alternatives

 

This chapter covers

  • Claude, from Anthropic
  • Command R+, from Cohere
  • Bard, from Google
  • Hugging Face’s models

Time to meet some of GPT’s “friends”! So far, we have been focusing on GPT and other OpenAI models. But OpenAI is not the only game in town. Quite the contrary: we are currently witnessing a “Cambrian explosion” of language models, with new models popping up every week. Before using language models in production, you want to make sure you’re using the best model for your task. In this chapter, we’ll look at many of the OpenAI alternatives out there and discuss the pros and cons of different models as well as how to use them.

Almost all language models nowadays are based on a similar architecture (the Transformer architecture). However, models from different providers may differ in the way they are trained, the way they represent text, or the way in which they are offered and priced. All those factors can make a difference in terms of processing fees and output quality for your specific task. Models like GPT-4o are powerful and solve almost any task. But this generality comes at a cost: if a small, specialized model is available, trained for just the task you’re interested in, using such a model may very well be the optimal choice.

8.1 Anthropic

8.1.1 Chatting with Claude

8.1.2 Python library

8.2 Cohere

8.2.1 Chatting with Command R+

8.2.2 Python library

8.3 Google

8.3.1 Chatting with Gemini

8.3.2 The Python library

8.4 Hugging Face

8.4.1 Web platform

8.4.2 Python library

Summary

8.6 References