Commit 7eec38ff authored by YaningGao's avatar YaningGao
Browse files

minor

parent 50e3b47b
Loading
Loading
Loading
Loading
+22 −23
Original line number Diff line number Diff line
models:
  # qwen_0.5b:
    # provider: vllm
    # model_name: Qwen/Qwen2.5-0.5B-Instruct
    # max_tokens: 1024
    # temperature: 0.7
    # tensor_parallel_size: 1
    # gpu_memory_utilization: 0.9
models:
  # qwen_0.5b:
    # provider: vllm
@@ -23,15 +15,15 @@ models:
  #   tensor_parallel_size: 2
  #   gpu_memory_utilization: 0.9

  gpt4o:
    provider: openai
    model_name: gpt-4o
    max_tokens: 1024
    temperature: 0.7
    presence_penalty: 0.0
    frequency_penalty: 0.0
    max_retries: 3
    timeout: 60
  # gpt4o:
  #   provider: openai
  #   model_name: gpt-4o
  #   max_tokens: 1024
  #   temperature: 0.7
  #   presence_penalty: 0.0
  #   frequency_penalty: 0.0
  #   max_retries: 3
  #   timeout: 60

  # gpt4_vision:
  #   provider: openai
@@ -43,11 +35,11 @@ models:
  #   max_retries: 3
  #   timeout: 60

  claude_3_sonnet:
    provider: claude
    model_name: claude-3-7-sonnet-20250219
    max_tokens: 1024
    temperature: 0.7
  # claude_3_sonnet:
  #   provider: claude
  #   model_name: claude-3-7-sonnet-20250219
  #   max_tokens: 1024
  #   temperature: 0.7
  
  # # Batch processing configuration example
  # claude_3_haiku_batch:
@@ -58,3 +50,10 @@ models:
  #   use_batch_api: true  # Use batch API for cost optimization
  #   batch_poll_interval: 10  # Poll every 10 seconds
  #   batch_max_wait_time: 7200  # Wait up to 2 hours

  Gemini_2.5_flask:
      provider: gemini
      model_name: gemini
      max_tokens: 1024
      temperature: 0.7
  
 No newline at end of file

test_frozenlake/frozenlake_0.png

deleted100644 → 0
−6.07 KiB
Loading image diff...
+4 −1
Original line number Diff line number Diff line
@@ -8,7 +8,10 @@ export OPENAI_API_KEY=<sk-your_openai_api_key>
pip install anthropic
export ANTHROPIC_API_KEY=<your_claude_api_key>
```

# Use Gemini API
```
export GOOGLE_API_KEY=<your_gemini_api_key>
```
## Test your inference pipeline
```
python vagen/server/server.py
+5 −0
Original line number Diff line number Diff line
from .vllm import VLLMModelInterface, VLLMModelConfig
from .openai import OpenAIModelInterface, OpenAIModelConfig
from .claude import ClaudeModelInterface, ClaudeModelConfig
from .gemini import GeminiModelInterface, GeminiModelConfig

REGISTERED_MODEL = {
    "vllm": {
@@ -14,5 +15,9 @@ REGISTERED_MODEL = {
    "claude": {
        "model_cls": ClaudeModelInterface,
        "config_cls": ClaudeModelConfig
    },
    "gemini": {
        "model_cls": GeminiModelInterface,
        "config_cls": GeminiModelConfig
    }
}
 No newline at end of file
+18 −5
Original line number Diff line number Diff line
@@ -38,11 +38,24 @@ class ModelFactory:
            available_providers = list(REGISTERED_MODEL.keys())
            raise ValueError(f"Unknown provider '{provider}'. Available providers: {available_providers}")
        
        try:
        # Get model and config classes from registry
        model_cls = REGISTERED_MODEL[provider]["model_cls"]
        config_cls = REGISTERED_MODEL[provider]["config_cls"]
        
        # Get provider info to validate model_name
        supported_models = []
        if hasattr(config_cls, 'get_provider_info'):
            provider_info = config_cls.get_provider_info()
            supported_models = provider_info.get("supported_models", [])
        
        # Validate model name before initialization
        if model_name and supported_models and model_name not in supported_models:
            raise ValueError(
                f"Invalid model '{model_name}' for provider '{provider}'. "
                f"Supported models: {supported_models}"
            )
        
        try:
            # Create config instance
            model_config = config_cls(**config)
            
@@ -51,7 +64,7 @@ class ModelFactory:
            
        except Exception as e:
            logger.error(f"Failed to initialize model interface: {str(e)}")
            raise
            raise ValueError(f"Failed to initialize model interface: {str(e)}")
    
    @staticmethod
    def create_from_config_instance(config: BaseModelConfig) -> BaseModelInterface:
Loading