Skip to content

OctopusXAI/multi-llm-api-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

multi-llm-api-starter

Lightweight unified multi-LLM API gateway.

Unify OpenAI and Gemini interface, one set of code calls all mainstream large models.

  • Unified request format, compatible with OpenAI standard SDK
  • Support local rapid deployment, zero complex configuration
  • Low resource consumption, suitable for backend service integration

Install Dependencies

pip install openai google-generativeai

Env Config

# Mac / Linux
export OPENAI_API_KEY=your_key_here
export GEMINI_API_KEY=your_key_here

# Windows CMD
set OPENAI_API_KEY=your_key_here
set GEMINI_API_KEY=your_key_here

Local Client Usage (unified_llm_client.py)

from unified_llm_client import UnifiedLLMClient

client = UnifiedLLMClient()

# Call OpenAI GPT
gpt_res = client.chat("gpt-4o", "your question")
print(gpt_res)

# Call Google Gemini
gem_res = client.chat("gemini-1.5-flash", "your question")
print(gem_res)

Params Explain

  • model_name: Specify target LLM model
  • prompt: Input query for model generation
  • Return: Raw text output from LLM

Supported Models

OpenAI Series

  • gpt-4o
  • gpt-4-turbo
  • gpt-3.5-turbo

Google Gemini Series

  • gemini-1.5-flash
  • gemini-1.5-pro

About

Lightweight unified multi-LLM API gateway, support OpenAI / Gemini, local deployment quick start template

Topics

Resources

License

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages