Skip to main content

Overview

PicoClaw supports any OpenAI-compatible API endpoint, enabling you to use:
  • Custom API proxies and gateways
  • Self-hosted models (VLLM, Ollama)
  • LiteLLM proxy for unified access
  • Local inference servers
  • Enterprise deployments

Custom API Endpoints

Basic Configuration

Any OpenAI-compatible endpoint can be configured:

Configuration Parameters

LiteLLM Proxy

What is LiteLLM?

LiteLLM is a unified proxy that translates requests across 100+ LLM providers. It provides:
  • Single API for multiple providers
  • Load balancing and fallbacks
  • Cost tracking and budgets
  • Rate limiting
  • Caching

Setup LiteLLM

1. Install LiteLLM

2. Create Configuration

Create litellm_config.yaml:

3. Start LiteLLM Proxy

4. Configure PicoClaw

Edit ~/.picoclaw/config.json:
PicoClaw strips the litellm/ prefix, so litellm/gpt-4 sends gpt-4 to the proxy.

5. Test Connection

Advanced LiteLLM Features

Load Balancing

LiteLLM config with multiple endpoints:
PicoClaw config:

VLLM (Self-Hosted)

What is VLLM?

VLLM is a high-performance inference server for running LLMs locally or in the cloud.

Setup VLLM

1. Install VLLM

2. Start VLLM Server

3. Configure PicoClaw

Edit ~/.picoclaw/config.json:

4. Test Connection

VLLM with Multiple GPUs

VLLM Best Practices

  1. GPU memory: Ensure sufficient VRAM for your model
  2. Batch size: Tune for throughput vs latency
  3. Context length: Set --max-model-len appropriately
  4. Timeouts: Increase request_timeout for large contexts

Ollama (Local Models)

What is Ollama?

Ollama makes it easy to run open-source LLMs locally on your machine.

Setup Ollama

1. Install Ollama

2. Pull a Model

Available models:
  • llama3 - Meta Llama 3
  • mistral - Mistral 7B
  • codellama - Code Llama
  • qwen2.5 - Qwen 2.5
  • Many more at https://ollama.ai/library

3. Start Ollama Server

Default endpoint: http://localhost:11434

4. Configure PicoClaw

Edit ~/.picoclaw/config.json:
No API key needed for Ollama - it’s completely local!

5. Test Connection

Ollama Best Practices

  1. Model selection: Choose models that fit your hardware
  2. Context window: Larger models support longer contexts
  3. Performance: Use GPU for better performance
  4. Updates: Keep Ollama updated for latest features

Custom Proxy Configuration

HTTP Proxy

Route requests through an HTTP proxy:

Reverse Proxy

Run your own reverse proxy:
PicoClaw config:

Enterprise Deployments

Azure OpenAI

AWS Bedrock

Use through LiteLLM proxy:

GCP Vertex AI

Use through LiteLLM proxy:

Troubleshooting

Connection Refused

Ensure your custom endpoint is running:

Timeout Errors

Increase timeout for slow endpoints:

API Key Issues

Some endpoints don’t require keys:
Omit api_key for local servers.

Protocol Mismatches

Ensure your endpoint is OpenAI-compatible:
  • Endpoint: /v1/chat/completions
  • Request format: OpenAI JSON schema
  • Response format: OpenAI JSON schema

Best Practices

  1. Use LiteLLM for complex multi-provider setups
  2. Local development with Ollama for privacy
  3. Production use VLLM for performance
  4. Monitoring add health checks and logging
  5. Security use HTTPS and authentication
  6. Timeouts set appropriate timeouts for your use case
  7. Fallbacks configure backup providers

Example Configurations

Multi-Provider Setup

Development Setup