Skip to main content

Python framework for AI agents logic-only coding with streaming, tool calls, and multi-LLM provider support

Project description

open-taranis

Python framework for AI agents logic-only coding with streaming, tool calls, and multi-LLM provider support.

Only the "fairly stable" versions are published on PyPi, but to get the latest experimental versions, clone this repository and install it !

Installation

pip install open-taranis --upgrade

For package on PyPi

or

git clone https://github.com/SyntaxError4Life/open-taranis && cd open-taranis/ && pip install .

For last version

Quick Start

Simplest
import open_taranis as T

client = T.clients.openrouter() # API_KEY in env_var

messages = [
    T.create_user_prompt("Tell me about yourself")
]

stream = T.clients.openrouter_request(
    client=client,
    messages=messages,
    model="nvidia/nemotron-3-nano-30b-a3b:free", 
)

print("assistant : ",end="")
for token, tool, tool_bool in T.handle_streaming(stream) : 
    if token :
        print(token, end="")
To create a simple display using gradio as backend
import open_taranis as T
import open_taranis.web_front as W
import gradio as gr

gr.ChatInterface(
    fn=W.chat_fn_gradio(
    client=T.clients.openrouter(), # API_KEY in env_var
    request=T.clients.openrouter_request,
    model="nvidia/nemotron-3-nano-30b-a3b:free",
    _system_prompt="You are an agent named **Taranis**"
).create_fn(),
    title="web front"
).launch()
Make a simple agent with a context windows on the 6 last turns
import open_taranis as T

class Agent(T.agent_base):
    def __init__(self):
        super().__init__()

        self.client = T.clients.openrouter()
        self._system_prompt = [T.create_system_prompt(
            "You're an agent nammed **Taranis** !"
        )]


    def create_stream(self):
        return T.clients.openrouter_request(
            client=self.client,
            messages=self._system_prompt+self.messages,
            model="nvidia/nemotron-3-nano-30b-a3b:free"
        )

    def manage_messages(self):
        self.messages = self.messages[-12:] # Each turn have 1 user and 1 assistant

My_agent = Agent()

while True :
    prompt = input("user : ")

    print("\n\nagent : ", end="")

    for t in My_agent(prompt):
        print(t, end="", flush=True)
    
    print("\n\n","="*60,"\n")

Use the commands :

  • taranis help : in the name...
  • taranis update : upgrade the framework
  • taranis open : open the TUI

The TUI :

TUI

  • /help to start

Documentation :

Roadmap

  • v0.0.1: start
  • v0.0.x: Add and confirm other API providers (in the cloud, not locally)
  • v0.1.x: Functionality verifications in examples
  • v0.2.x: Add features for logic-only coding approach, start with agent_base
  • v0.3.x: Add a full agent in TUI and upgrade web client deployments
  • The rest will follow soon.

Changelog

v0.0.x : The start
  • v0.0.4 : Add xai and groq provider
  • v0.0.6 : Add huggingface provider and args for clients.veniceai_request
v0.1.x : Gradio, commands and TUI
  • v0.1.0 : Start the docs, add update-checker and preparing for the continuation of the project...
  • v0.1.1 : Code to deploy a frontend with gradio added (no complex logic at the moment, ex: tool_calls)
  • v0.1.2 : Fixed a display bug in the web_front and experimentally added ollama as a backend
  • v0.1.3 : Fixed the memory reset in the web_front and remove ollama module for openai front (work 100 times better)
  • v0.1.4 : Fixed web_front for native use on huggingface, as well as handle_streaming which had tool retrieval issues
  • v0.1.7 : Added a TUI and commands, detection of env variables (API keys) and tools in the framework
v0.2.x : Agents
  • v0.2.0 : Adding agent_base
  • v0.2.1 : Updated agent_base and added a more concrete example of agents
  • v0.2.2 : Upgraded all the code to add Kimi Code as client and reduce code (Not official !)

Advanced Examples

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

open_taranis-0.2.2.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

open_taranis-0.2.2-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file open_taranis-0.2.2.tar.gz.

File metadata

  • Download URL: open_taranis-0.2.2.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for open_taranis-0.2.2.tar.gz
Algorithm Hash digest
SHA256 67e052d09f8b1e3f7c3fbbc8ccec9f4b602aa73395531ce7ae17458f4b1b5687
MD5 2dd59347b3b3066370dcb3330d830d02
BLAKE2b-256 1f8a41ba38777ea5ffa15c2a49b192a74dfef2a41d51ce24197ee80df1f86e5d

See more details on using hashes here.

File details

Details for the file open_taranis-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: open_taranis-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for open_taranis-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7d545214cebadd051248eeeed7a996252641f5c2d1ccecc58cd808fa3cf5a925
MD5 f42a36de18bc41a3eda0840e45285436
BLAKE2b-256 ff33c5db6545ac6ed48fb3fb2ec56b46e716c339985295808467e7a9032909a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page