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
Createlitellm_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: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
- GPU memory: Ensure sufficient VRAM for your model
- Batch size: Tune for throughput vs latency
- Context length: Set
--max-model-lenappropriately - Timeouts: Increase
request_timeoutfor 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
llama3- Meta Llama 3mistral- Mistral 7Bcodellama- Code Llamaqwen2.5- Qwen 2.5- Many more at https://ollama.ai/library
3. Start Ollama Server
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
- Model selection: Choose models that fit your hardware
- Context window: Larger models support longer contexts
- Performance: Use GPU for better performance
- 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: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: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
- Use LiteLLM for complex multi-provider setups
- Local development with Ollama for privacy
- Production use VLLM for performance
- Monitoring add health checks and logging
- Security use HTTPS and authentication
- Timeouts set appropriate timeouts for your use case
- Fallbacks configure backup providers