No project description provided
Project description
TableGPT Agent
Introduction
tablegpt-agent
is a pre-built agent for TableGPT2 (huggingface), a series of LLMs for table-based question answering. This agent is built on top of the Langgraph library and provides a simple interface for interacting with the TableGPT model.
Installation
pip install tablegpt-agent
tablegpt-agent
depends on pybox, which is a Python code sandbox delegator. pybox
defaults to an in-cluster mode. If you want to run tablegpt-agent
in a local environment, you need to install an optional dependency:
pip install pppybox[local]
Quick Start
Before using tablegpt-agent
, ensure you have an OpenAI-compatible server set up to host TableGPT2. We recommend using vllm for this:
python -m vllm.entrypoints.openai.api_server --served-model-name TableGPT2-7B --model path/to/weights
Note: For production environments, it’s important to optimize the vllm server configuration. For details, refer to the vllm documentation on server configuration.
After setting up the server, you can use the following code to interact with the TableGPT model:
from datetime import date
from langchain_core.messages import HumanMessage
from langchain_openai import ChatOpenAI
from tablegpt.agent import create_tablegpt_graph
from pybox import LocalPyBoxManager
llm = ChatOpenAI(openai_api_base=YOUR_VLLM_URL, openai_api_key="whatever", model_name="TableGPT2-7B")
pybox_manager = LocalPyBoxManager()
agent = create_tablegpt_graph(
llm=llm,
pybox_manager=app_state.pybox_manager,
)
message = HumanMessage(content="Hi")
input = {
"messages": [message],
"parent_id": "some-parent-id",
"date": date.today(),
}
async for event in agent.astream_events(
input=input,
version="v2",
):
print(event)
Workflow
Main workflow
File Upload workflow
Code Execution
The tablegpt-agent
directs tablegpt
to generate python code for performing data analysis. This code is then executed within a sandbox environment to maintain system security. The execution is managed by the pybox library, which offers a straightforward way to run Python code outside the main process.
Plugins
Liscence
Model Card
See model_card.md.
Citation
If you find our work helpful, please cite us by
@misc{
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tablegpt_agent-0.2.5.tar.gz
.
File metadata
- Download URL: tablegpt_agent-0.2.5.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 655ce11b3dcf3fd39aea8e461bf26e3d8872cf14119bb82030150e69ae1ae56d |
|
MD5 | ee5cecb12258087b175bdb33417b03b7 |
|
BLAKE2b-256 | a63b07caf75f1569f1421c0f89c5bcf5bb1bc5c157e08becf749e97895ebacf6 |
Provenance
The following attestation bundles were made for tablegpt_agent-0.2.5.tar.gz
:
Publisher:
publish.yml
on tablegpt/tablegpt-agent
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tablegpt_agent-0.2.5.tar.gz
- Subject digest:
655ce11b3dcf3fd39aea8e461bf26e3d8872cf14119bb82030150e69ae1ae56d
- Sigstore transparency entry: 146257290
- Sigstore integration time:
- Predicate type:
File details
Details for the file tablegpt_agent-0.2.5-py3-none-any.whl
.
File metadata
- Download URL: tablegpt_agent-0.2.5-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb1d1d00c8a5fd0ff2a3e8da5afbbb26398e580e9b73fe8f0903875c8f99b8e8 |
|
MD5 | d988e11070d78b8681e74a2792d47f39 |
|
BLAKE2b-256 | 1456c155a7d0d44d7c62f4b541a1d1f1187446a4a7bf491f712345d0ef80552c |
Provenance
The following attestation bundles were made for tablegpt_agent-0.2.5-py3-none-any.whl
:
Publisher:
publish.yml
on tablegpt/tablegpt-agent
-
Statement type:
https://in-toto.io/Statement/v1
- Predicate type:
https://docs.pypi.org/attestations/publish/v1
- Subject name:
tablegpt_agent-0.2.5-py3-none-any.whl
- Subject digest:
bb1d1d00c8a5fd0ff2a3e8da5afbbb26398e580e9b73fe8f0903875c8f99b8e8
- Sigstore transparency entry: 146257292
- Sigstore integration time:
- Predicate type: