Skip to content

Freakwill/ollama-easy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 

Repository files navigation

ollama-easy

An easy extension of ollama(-python)

See Ollama, https://github.com/ollama/ollama-python

Also see https://github.com/Freakwill/chat-tools

Requirements

  1. install ollama and its SDK
  2. save API Key in path ollama_ez/.env

Clients

  • OllamaChat: gpt-oss:120b by default (set api key)
  • LocalOllamaChat: use local model, gemma3 by default (download the model by ollama)

Attributes

Main attributes of OllamaChat

  • description="......"
  • history=[]
  • name='Assistant'
  • model='gpt-oss:120b'
  • api_key=<your api key>

Examples

from ollama_ez import OllamaChat # or LocalOllamaChat

with OllamaChat() as chat:
    chat.run()

Commands

In chat looping:

  • .attr value: set the attribute attr to be the value (e.g. .model deepseek-r1 to shift the llm)
  • :arg value: set the argument arg in chat method (i.e. chat_params) to be the value
  • !cmd *args: run command cmd(obj, *args) (registered in Commands)

About

An easy extension of ollama(-python)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages