For the complete documentation index, see llms.txt. This page is also available as Markdown.

Chat Completion

Introduction

Modellake provides an advanced chat completion functionality that allows users to interact with various LLM (Large Language Model) providers such as OpenAI (GPT-4), Gemini, DeepSeek, Claude, and Llama. This enables seamless integration of multiple AI models into applications for different conversational and generative AI use cases.

Setting Up API Keys

To use chat_complete, you need to set API keys for different AI models.

1. Setting API Keys in Terminal (Windows)

shCopyEditset OPENAI_API_KEY=your_openai_key
set GOOGLE_API_KEY=your_gemini_key
set DEEPSEEK_API_KEY=your_deepseek_key
set GROQ_API_KEY=your_llama_key
set ANTROPHIC_API_KEY=your_claude_key

2. Using a .env File

shCopyEditOPENAI_API_KEY=your_openai_key
GOOGLE_API_KEY=your_gemini_key
DEEPSEEK_API_KEY=your_deepseek_key
GROQ_API_KEY=your_llama_key
ANTROPHIC_API_KEY=your_claude_key

Usage of chat_complete() in Modellake

1. OpenAI (GPT-4) Chat Completion

Response

2. Google Gemini Chat Completion

Response

3. DeepSeek Chat Completion

Response

4. Claude Chat Completion

Response

5. Llama Chat Completion (via Groq API)

Getting a Groq API Key

To use Llama models, obtain an API key from Groq:

  1. Sign up on the Groq Developer Console.

  2. Navigate to API Keys and generate a new key.

  3. Securely store and use the key in your application.

Llama Chat Example

Response

Last updated