Installation¶
Requirements¶
Install from PyPI¶
Or using uv:
Install from Source¶
Provider-Specific Setup¶
Cloud Providers¶
Most cloud providers require API keys. Set them as environment variables:
# OpenAI
export OPENAI_API_KEY="your-key"
# Anthropic
export ANTHROPIC_API_KEY="your-key"
# Google Gemini
export GOOGLE_API_KEY="your-key"
# Cohere
export COHERE_API_KEY="your-key"
# Mistral
export MISTRAL_API_KEY="your-key"
# Groq
export GROQ_API_KEY="your-key"
# Together AI
export TOGETHER_API_KEY="your-key"
# OpenRouter
export OPENROUTER_API_KEY="your-key"
# DeepSeek
export DEEPSEEK_API_KEY="your-key"
# Hugging Face
export HF_TOKEN="your-token"
Local Models with Ollama¶
- Install Ollama
- Pull a model:
ollama pull llama3.2 - Start the Ollama server (runs by default on
http://localhost:11434)
Local Models with vLLM¶
- Install vLLM:
pip install vllm - Start the server:
python -m vllm.entrypoints.openai.api_server --model your-model
from negmas_llm import VLLMNegotiator
negotiator = VLLMNegotiator(
model="your-model",
api_base="http://localhost:8000/v1"
)
Local Models with LM Studio¶
- Download LM Studio
- Load a model and start the local server
from negmas_llm import LMStudioNegotiator
negotiator = LMStudioNegotiator() # Uses default localhost:1234