Allama is your ultimate gateway to the world of AI, offering a powerful and intuitive API router that seamlessly integrates multiple AI model providers into one unified platform. Allama simplifies your workflow by providing a single, elegant API endpoint. Say goodbye to the hassle of managing different provider configurations—Allama handles the complexity, letting you focus on creating groundbreaking AI solutions with ease.
- Unified API: Access multiple AI providers through a single RESTful API.
- Provider Management: Easily configure and manage different AI service providers.
- Model Aggregation: List and interact with models from various providers as if they were hosted locally.
- Database Integration: Store provider and model information persistently for quick access and management.
To get started with Allama, you can clone the repository and build the application locally or use the provided Docker setup for a containerized environment.
- Go 1.18 or higher (for building from source)
- Docker and Docker Compose (for containerized setup)
- Git (for cloning the repository)
git clone https://github.com/offbeat-studio/allama.git
cd allamaThe easiest way to run Allama is using Docker Compose, which sets up the application and its dependencies in isolated containers.
- Ensure Docker and Docker Compose are installed on your system.
- Copy the
src/example.envfile tosrc/.envand update the environment variables as needed (e.g., API keys for providers).cp src/example.env src/.env
- From the root of the repository, run:
docker-compose -f Docker/docker-compose.yml up --build
- Allama will be accessible at
http://localhost:11435.
If you prefer to build and run Allama directly on your system:
- Ensure Go is installed on your system.
- Copy the
src/example.envfile tosrc/.envand update the environment variables as needed.cp src/example.env src/.env
- From the
srcdirectory, build and run the application:cd src go mod tidy go run main.go - Allama will be accessible at
http://localhost:8080(or the port specified in your configuration).
Once Allama is running, you can interact with it through its API endpoints. Here are some basic operations:
- List Models: Retrieve a list of available models from all configured providers.
curl http://localhost:8080/api/v1/models
- Chat Completions: Send chat messages to a specific model.
curl -X POST http://localhost:8080/api/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content": "Hello, how are you?"}]}'
For compatibility with Ollama clients, Allama also supports Ollama-specific endpoints:
- List Tags: Retrieve model tags as if querying an Ollama server.
curl http://localhost:8080/api/tags
Allama uses environment variables for configuration. You can set these in a .env file in the src directory or directly in your environment. Key variables include:
PORT: The port on which the Allama server runs (default: 8080).DATABASE_PATH: Path to the SQLite database file for storing provider and model data.- Provider-specific variables like
OPENAI_API_KEY,ANTHROPIC_API_KEY, and enable flags likeOPENAI_ENABLED=true.
We welcome contributions to Allama! Whether it's bug fixes, new features, or documentation improvements, your help is appreciated. Here's how you can contribute:
If you encounter any bugs or have feature requests, please open an issue on the GitHub repository. Provide as much detail as possible, including steps to reproduce the issue, expected behavior, and actual behavior.
- Fork the Repository: If you're not a core contributor, fork the Allama repository to your own GitHub account.
- Clone the Repository: Clone the repository to your local machine.
git clone https://github.com/offbeat-studio/allama.git cd allama - Create a Branch: Create a new branch for your changes with a descriptive name.
git checkout -b feature/your-feature-name
- Make Changes: Implement your changes, ensuring to follow the coding style and conventions used in the project.
- Test Your Changes: Make sure your changes do not break existing functionality and add tests if applicable.
- Commit Your Changes: Write clear, concise commit messages that describe the purpose of your changes.
git commit -m "Add feature: description of your feature" - Push to GitHub: Push your branch to the repository.
git push origin feature/your-feature-name
- Open a Pull Request: Go to the GitHub repository page, switch to your branch, and click "New Pull Request". Fill out the PR template with details about your changes, referencing any related issues.
- Follow Go best practices and conventions.
- Use meaningful variable and function names.
- Comment your code where necessary to explain complex logic.
- Ensure your code is formatted with
go fmt.
To set up the development environment:
- Install Go and necessary tools.
- Clone the repository and navigate to the
srcdirectory. - Install dependencies:
go mod tidy
- Run tests to ensure everything is working:
go test ./...
Allama is open-source software released under the MIT License. You are free to use, modify, and distribute this software as long as you include the original copyright and license notice in any copy of the software/source.
For questions or further information, you can reach out to the maintainers via GitHub issues or through the contact details provided in the repository.
Thank you for using and contributing to Allama!
