Code Monkey home page Code Monkey logo

llmx's People

Contributors

alexhorduz avatar bx-h avatar victordibia avatar vignesh-arivazhagan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

llmx's Issues

Support Setting Default LLM from Env Variable

What

For certain use cases e.g., cli scripts and web apps, it is important to provide some mechanism to externally set the default LLM provider and configuration

Work Items

  • set LLMX_CONFIG environment variable which should be a path to the configuration for a model
  • in llmx.generators.text.textgen.py , check for an available config and use to instantiate llm() . Merge provided kwargs with the content of the config file, with kwargs taking precedence

Support for palm api usage stats

What

In many cases it is useful to keep track of the token usage for each query and associated costs. Different model provider apis handle this differently (some provide this information as part of a generate query response) and the task is to return accurate usage states in a unified format for all model providers

Work Items

  • OpenAI/AzureOpenAI
  • HuggingFace
  • PALM
    • Extend response from palm api to include usage information.
    • Standardize on usage format for all apis

Palm api response provides the following fields.

"metadata": {
    "tokenMetadata": {
      "input_token_count": {
        "total_tokens": integer,
        "total_billable_characters": integer
      },
      "output_token_count": {
        "total_tokens": integer,
        "total_billable_characters": integer
      }
    }
  }

Support for Llama.cpp LLMs

It would be interesting to try out the recently released lida library with LLMs running locally using Llama.cpp.

Could llmx support such "offline"/embedded or standalone more resource constrained scenarios with LLMs using only CPUs?

If so, can you provide an outline of steps required?

Visualise structured DBs

Currently the data needs to be stored as a pandas dataframe in memory. Is there any scope to extend this project to large scale databases that use pyspark dataframes or sql

Update the openai version

llmx package is used with lida.

Update the openai version please

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

You can run openai migrate to automatically upgrade your codebase to use the 1.0.0 interface.

Alternatively, you can pin your installation to the old version, e.g. pip install openai==0.28

A detailed migration guide is available here: openai/openai-python#742

No support for Azure OpenAI

Hello Victor :)

I really like what you are doing and want to use the recently released lida library for projects in my organization.
However, my organization uses Azure OpenAI.
For this we need to be able to specfiy three openai properties:

  • openai.api_type
  • openai.api_base
  • openai.version

Here is an example authorization for an Azure OpenAI instance:

import openai
openai.api_type = "azure"
openai.api_base = "https://yourendpoint.openai.azure.com/"
openai.api_version = "2023-07-01-preview"
openai.api_key = os.getenv("OPENAI_API_KEY")

Can you please add these properties to llmx so it is possible to use lida?

Best regards
Marvin

Error processing file: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again. : Can anyone provide one single working example for Azure OpenAI ?

I've been trying to set up a working example of Azure OpenAI but in vain...

I think the documentation about this LLM provider should be very clear and not just dealt with in a sentence.. it's not about just setting up the env vars.. I've been trying to work around it for almost one hour now, but I don't know how to set the model, etc. I think it's really poorly documented.

Could anyone help please ?

MODEL_NAME=demo-llm
AZURE_OPENAI_BASE=https://******************.openai.azure.com/
AZURE_OPENAI_API_KEY=*********************
AZURE_OPENAI_API_TYPE=azure
AZURE_OPENAI_API_VERSION=2023-07-01-preview

I tried this:

provider = sanitize_provider("azureopenai")

text_gen = OpenAITextGenerator(
                # provider="azureopenai",
               api_type="azure",
               api_base=os.environ["AZURE_OPENAI_BASE"],
               api_key=os.environ["AZURE_OPENAI_API_KEY"],
               api_version="2023-07-01-preview",
               models =[os.environ["MODEL_NAME"]],
                provider=provider,
)

and this

text_gen = llm(provider="azureopenai",
               api_type="azure",
               api_base=os.environ["AZURE_OPENAI_BASE"],
               api_key=os.environ["AZURE_OPENAI_API_KEY"],
               api_version="2023-07-01-preview",
               model =os.environ["MODEL_NAME"],
               ) # for azure openai

I get Error processing file: The API deployment for this resource does not exist. If you created the deployment within the last 5 minutes, please wait a moment and try again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.