semvec/pypi-packages huggingface dataset:
hyperbolic-gradio 0.0.5
A Python package for creating Gradio applications with Hyperbolic AI models
Requires Python: >=3.10

# `hyperbolic-gradio`

is a Python package that makes it very easy for developers to create machine learning apps that are powered by Hyperbolic AI's API.

# Installation

You can install `hyperbolic-gradio` directly using pip:

```bash
pip install hyperbolic-gradio
```

That's it! 

# Basic Usage

Just like if you were to use the `hyperbolic` API, you should first save your Hyperbolic API key to this environment variable:

```
export HYPERBOLIC_API_KEY=<your token>
```

Then in a Python file, write:

```python
import gradio as gr
import hyperbolic_gradio

gr.load(
    name='meta-llama/Meta-Llama-3-70B-Instruct',
    src=hyperbolic_gradio.registry,
).launch()
```

Run the Python file, and you should see a Gradio Interface connected to the model on Hyperbolic AI!

![ChatInterface](https://raw.githubusercontent.com/HyperbolicLabs/hyperbolic-gradio/master/chatinterface.png)

# Customization 

Once you can create a Gradio UI from an Hyperbolic API endpoint, you can customize it by setting your own input and output components, or any other arguments to `gr.Interface`. For example, the screenshot below was generated with:

```py
import gradio as gr
import hyperbolic_gradio

gr.load(
    name='meta-llama/Meta-Llama-3-70B-Instruct',
    src=hyperbolic_gradio.registry,
    title='Hyperbolic-Gradio Integration',
    description="Chat with Meta-Llama-3-70B-Instruct model.",
    examples=["Explain quantum gravity to a 5-year old.", "How many R are there in the word Strawberry?"]
).launch()
```
![ChatInterface with customizations](https://raw.githubusercontent.com/HyperbolicLabs/hyperbolic-gradio/master/hyperbolic-gradio.png)

# Composition

Or use your loaded Interface within larger Gradio Web UIs, e.g.

```python
import gradio as gr
import hyperbolic_gradio

with gr.Blocks() as demo:
    with gr.Tab("Meta-Llama-3-70B-Instruct"):
        gr.load('meta-llama/Meta-Llama-3-70B-Instruct', src=hyperbolic_gradio.registry)
    with gr.Tab("Llama-3.2-3B-Instruct"):
        gr.load('meta-llama/Llama-3.2-3B-Instruct', src=hyperbolic_gradio.registry)

demo.launch()
```

# Under the Hood

The `hyperbolic-gradio` Python library has two dependencies: `hyperbolic` and `gradio`. It defines a "registry" function `hyperbolic_gradio.registry`, which takes in a model name and returns a Gradio app.

# Supported Models in Hyperbolic AI

All chat API models supported by Hyperbolic AI are compatible with this integration. For a comprehensive list of available models and their specifications, please refer to the [Hyperbolic AI Models documentation](https://platform.hyperbolic.ai/docs/models).

-------

Note: if you are getting a 401 authentication error, then the Hyperbolic API Client is not able to get the API token from the environment variable. This happened to me as well, in which case save it in your Python session, like this:

```py
import os

os.environ["HYPERBOLIC_API_KEY"] = ...
```
fuelfinder 0.1.3
Add your description here
Requires Python: >=3.12

# Fuelfinder

Fuelfinder is a Python tool to scrape fuel prices from [fuelfinder.dk](https://www.fuelfinder.dk). It provides functionality to fetch current fuel prices while maintaining rate limiting and local caching, ensuring minimal requests to the server.

## Features
- **Scrape Fuel Prices**: Get up-to-date fuel prices from the `fuelfinder.dk` website.
- **Rate Limiting**: Ensures that requests to the server are made no more than once every 5 minutes using a persistent cache.
- **Command-Line Interface (CLI)**: Built using Typer, allowing easy usage and configuration.
- **Debug Logging**: Optional debug logging using Python's built-in logging for better transparency and troubleshooting.
- **Pre-commit Setup**: Uses `ruff` to ensure the code meets quality and consistency standards.

## Installation

To install Fuelfinder, clone the repository and use [uv](https://github.com/astral-sh/uv) to manage dependencies:

```sh
# Clone the repository
git clone https://github.com/yourusername/fuelfinder.git
cd fuelfinder

# Install dependencies using uv
uv sync
```

## Usage

You can use the Fuelfinder CLI to fetch danish fuel prices directly from the command line:

```sh
# Run Fuelfinder
uvx run fuelfinder
```

### Command-line Options
- `--url`: The URL to fetch gas prices from (can also be set via the environment variable `FUELLIST_URL`).
- `--debug`: Enable debug logging for more detailed output.

For example:

```sh
uvx fuelfinder --debug
```

## Pre-commit Hooks
This project uses [pre-commit](https://pre-commit.com/) to ensure code quality. The hooks used include:
- **Ruff**: A fast Python linter and code formatter.
- **Pre-commit Hooks**: Various checks, including trailing whitespace and YAML/JSON validation.

To set up pre-commit hooks:

```sh
pre-commit install
```

To run the hooks manually on all files:

```sh
pre-commit run --all-files
```

## Configuration

The caching for fuel prices is implemented using `diskcache` and is stored in `~/.cache/fuelfinder_cache` to persist across invocations. The default caching duration is 5 minutes.

## Development

If you want to contribute to Fuelfinder, feel free to submit a pull request. Please make sure your code adheres to the following guidelines:
- Ensure the code passes all pre-commit hooks.
- Write clear and concise documentation for any new functionality.

## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Acknowledgments
- [fuelfinder.dk](https://www.fuelfinder.dk) for providing the data source.
- The authors of `ruff`, `typer`, `diskcache`, and other open-source projects used in this tool.