Skip to content

ai-nikolai/simple-llm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple AI - A very simple wrapper around OpenAI SDK to allow for OpenAI compatible queries for OpenAI, Anthropic and Gemini

"Does what is says on the tin." - good friend.

Getting Started:

  1. Installation:
pip3 install git+https://github.com/ai-nikolai/simple-llm.git
  1. Running:
from simple_ai import get_anthropic_generator, get_openai_generator, get_gemini_generator

# Create the client.
llm = get_anthropic_generator(model_name="claude-3-7-sonnet-20250219")


messages = [
    {
        "role" : "user",
        "content" : "Hello, could you tell me how to become a better human?",
    },
]

# Get the response as list of str
responses = llm(messages)

print(responses[0])

More Advanced examples and parameters:

from simple_ai import get_anthropic_generator, get_openai_generator, get_gemini_generator

# Create the client.
llm = get_gemini_generator(model_name="gemini-2.5-flash-preview-05-20", default_reasoning_effort="low")

# Create a messages object in OpenAI format.
messages = [
    {
        "role" : "system",
        "content" : "You are wise like Master Yoda.",
    },
    {
        "role" : "user",
        "content" : "Hello, could you tell me how to become a better human?",
    },
]

# Get the response as list of str
responses = llm(
    messages, 
    num_generations=1,
    max_completion_tokens=2000,
    temperature=0.0,
    # other params are also possible have a look inside: simple_vllm/llm.py
    )

# print response.
print(responses[0])

This is the response you should get:

A better human, you wish to be? A noble path, this is. Not a destination, but a journey, it is.

First, look inward, you must. Know yourself, truly. Your strengths, your weaknesses, your fears. For understanding, the first step it is.

Then, let go. Fear, anger, attachment... clouds they are, obscuring your true self. Release them, you must.

Compassion, practice. For others, yes. But for yourself, too. Kindness, a powerful Force it is.

Action, not just thought, brings change. Do. Not merely try. Small steps, taken consistently, lead far.

Patience, you must have. Growth, slow it is, like a seed becoming a tree. Mistakes, make them you will. Learn from them, you must. A teacher, failure can be.

Balance, seek always. Light and shadow, within you they dwell. Acknowledge both, but choose the path of wisdom and peace.

Present, be. The moment, all there is. Live fully, you must.

A better human, you already are, in the striving. Continue to learn, to grow, to connect. The Force, within you, guides.

(C) - Nikolai Rozanov, 2025 - Present

About

Simple LLM API Wrapper for Gemini, Anthropic in OpenAI compatible fashion.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages