Download the PHP package jtsternberg/localgpt without Composer

On this page you can find all versions of the php package jtsternberg/localgpt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package localgpt

LocalGPT

LocalGPT

A command-line interface for creating and interacting with local, file-based custom GPTs, powered by your favorite AI providers.

This tool is designed to be extensible, allowing you to wrap any AI API.

Providers currently supported:

With more providers coming soon.

Table of Contents generated with DocToc

Features

Prerequisites

Installation & Configuration

  1. Install the tool via Composer:

    Note: Make sure your global Composer bin directory is in your system's PATH.

  2. Set up your API keys. Copy the example environment file:

  3. Add your API key to the new .env file. For now, we only need Gemini:

The CLI will automatically load the required API key based on the provider specified in your GPT's configuration file.

Getting Started

This guide will walk you through creating and interacting with your first custom GPT.

Step 1: Create a New GPT

Use the new command to start the interactive wizard:

The wizard will guide you through configuring your GPT's title, description, provider, model, and system prompt.

You will see a new directory created named my-first-gpt/ with the following files:

If you want to modify your GPT's prompt in the future, simply edit the SYSTEM_PROMPT.md file.

Step 2: Chat with Your GPT

Once your GPT is created, start a chat session with the chat command:

You can now interact with your custom GPT directly from your terminal.

To simply get a one-time response from your GPT, you can use the chat command with the --message flag:

(or use --messageFile to send a file's content as the message)

Step 3: Chat with Examples

You can also chat with one of the examples:

Commands

Command: new

Creates a new GPT configuration via an interactive wizard.

This will launch a step-by-step wizard that asks you for the following information:

The wizard will create a new directory named after the slug you provide (e.g., my-first-gpt/). This directory will contain your gpt.json configuration file and any other related files, like the SYSTEM_PROMPT.md.

This approach keeps your custom GPTs organized and makes them easy to track in version control alongside your projects.

Command: chat

Starts an interactive chat session with a specified GPT.

Non-interactive Mode

You can also send a single message or a file directly to the GPT without starting an interactive session.

Send a message:

Send a file's content:

In non-interactive mode, the response is sent directly to stdout.

Command: models

Lists all available models from the supported AI providers.

Note: For the ollama provider, this command will list the models you have pulled locally.

Command: reference

Adds, removes, or lists reference files for a specified GPT.

List reference files:

Add a reference file:

Remove a reference file:

This command will copy the specified file to the GPT's reference-files directory and update the gpt.json configuration.

Examples

This repository includes several README for more information.

Example Session:

Additional Features

Reference Files

You can provide your GPT with local files to use as reference material. This is useful for providing additional context.

To use reference files, add a reference_files array to your gpt.json file. The array should contain a list of relative paths to the files you want to include.

When you start a chat session, the content of these files will be loaded and included in the system prompt that is sent to the LLM. This allows the GPT to use the information in the files to inform its responses.

Manual Configuration

You can create a [name]/gpt.json file yourself. Review the examples/pizza-pro-gemini-2.5-flash/gpt.json file for an example of the structure.


All versions of localgpt with dependencies

PHP Build Version
Package Version
Requires symfony/console Version ^7.3
vlucas/phpdotenv Version ^5.6
google-gemini-php/client Version ^2.3
php-http/guzzle7-adapter Version ^1.1
theodo-group/llphant Version ^0.10.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jtsternberg/localgpt contains the following files

Loading the files please wait ...