diff --git a/examples/to_json/combined_llm_pricing_models.json b/examples/to_json/combined_llm_pricing_models.json new file mode 100644 index 0000000..19a95bb --- /dev/null +++ b/examples/to_json/combined_llm_pricing_models.json @@ -0,0 +1,1136 @@ +[ + { + "model": "gpt-4-32k", + "provider": "OpenAI", + "input_tokens_price": "60", + "output_tokens_price": "120", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4", + "provider": "OpenAI", + "input_tokens_price": "30", + "output_tokens_price": "60", + "context": "8K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4o", + "provider": "OpenAI", + "input_tokens_price": "5", + "output_tokens_price": "15", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-05-16" + }, + { + "model": "gpt-4o-2024-08-06", + "provider": "OpenAI", + "input_tokens_price": "2.5", + "output_tokens_price": "10", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-08-16" + }, + { + "model": "gpt-4o-mini", + "provider": "OpenAI", + "input_tokens_price": "0.15", + "output_tokens_price": "0.6", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-07-19" + }, + { + "model": "gpt-4-turbo-2024-04-09", + "provider": "OpenAI", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-11" + }, + { + "model": "gpt-4-0125-preview", + "provider": "OpenAI", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4-1106-preview", + "provider": "OpenAI", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4-vision-preview", + "provider": "OpenAI", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-0125", + "provider": "OpenAI", + "input_tokens_price": "0.5", + "output_tokens_price": "1.5", + "context": "16K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-instruct", + "provider": "OpenAI", + "input_tokens_price": "1.5", + "output_tokens_price": "2", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-1106", + "provider": "OpenAI", + "input_tokens_price": "1", + "output_tokens_price": "2", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-0613", + "provider": "OpenAI", + "input_tokens_price": "1.5", + "output_tokens_price": "2", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-16k-0613", + "provider": "OpenAI", + "input_tokens_price": "3", + "output_tokens_price": "4", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-3.5-turbo-0301", + "provider": "OpenAI", + "input_tokens_price": "1.5", + "output_tokens_price": "2", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4-turbo", + "provider": "Azure", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gpt-4-turbo-vision", + "provider": "Azure", + "input_tokens_price": "10", + "output_tokens_price": "30", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-3.5-sonnet", + "provider": "Anthropic", + "input_tokens_price": "3", + "output_tokens_price": "15", + "context": "200K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-06-26" + }, + { + "model": "claude-3-opus", + "provider": "Anthropic", + "input_tokens_price": "15", + "output_tokens_price": "75", + "context": "200K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-3-sonnet", + "provider": "Anthropic", + "input_tokens_price": "3", + "output_tokens_price": "15", + "context": "200K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-3-haiku", + "provider": "Anthropic", + "input_tokens_price": "0.25", + "output_tokens_price": "1.25", + "context": "200K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-2.1", + "provider": "Anthropic", + "input_tokens_price": "8", + "output_tokens_price": "24", + "context": "200K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-2.0", + "provider": "Anthropic", + "input_tokens_price": "8", + "output_tokens_price": "24", + "context": "100K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-instant-1.2", + "provider": "Anthropic", + "input_tokens_price": "0.8", + "output_tokens_price": "2.4", + "context": "100K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "jurassic-2-ultra", + "provider": "AWS", + "input_tokens_price": "18.8", + "output_tokens_price": "18.8", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "jurassic-2-mid", + "provider": "AWS", + "input_tokens_price": "12.5", + "output_tokens_price": "12.5", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "titan-text-lite", + "provider": "AWS", + "input_tokens_price": "0.3", + "output_tokens_price": "0.4", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "titan-text-express", + "provider": "AWS", + "input_tokens_price": "0.8", + "output_tokens_price": "1.6", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-instant", + "provider": "AWS", + "input_tokens_price": "0.8", + "output_tokens_price": "2.4", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "claude-2.0/2.1", + "provider": "AWS", + "input_tokens_price": "8", + "output_tokens_price": "24", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "command", + "provider": "AWS", + "input_tokens_price": "1.5", + "output_tokens_price": "2", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "command-light", + "provider": "AWS", + "input_tokens_price": "0.3", + "output_tokens_price": "0.6", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "llama-2-chat-13B", + "provider": "AWS", + "input_tokens_price": "0.75", + "output_tokens_price": "1", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "llama-2-chat-70B", + "provider": "AWS", + "input_tokens_price": "1.95", + "output_tokens_price": "2.56", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mistral-7b", + "provider": "AWS", + "input_tokens_price": "0.15", + "output_tokens_price": "0.2", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mistral-8x7b", + "provider": "AWS", + "input_tokens_price": "0.45", + "output_tokens_price": "0.7", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gemini-1.0-pro", + "provider": "Google", + "input_tokens_price": "0.5", + "output_tokens_price": "1.5", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gemini-1.5-pro", + "provider": "Google", + "input_tokens_price": "3.5", + "output_tokens_price": "10.5", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-04" + }, + { + "model": "gemini-1.5-flash", + "provider": "Google", + "input_tokens_price": "0.08", + "output_tokens_price": "0.3", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-08-11" + }, + { + "model": "palm-2-for-chat", + "provider": "Google", + "input_tokens_price": "0.25", + "output_tokens_price": "0.5", + "context": "8K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "palm-2-for-chat-32k", + "provider": "Google", + "input_tokens_price": "0.25", + "output_tokens_price": "0.5", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "palm-2-for-text", + "provider": "Google", + "input_tokens_price": "2.5", + "output_tokens_price": "7.5", + "context": "8K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "palm-2-for-text-32k", + "provider": "Google", + "input_tokens_price": "2.5", + "output_tokens_price": "5", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mistral-large", + "provider": "Mistral", + "input_tokens_price": "8", + "output_tokens_price": "24", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mistral-medium", + "provider": "Mistral", + "input_tokens_price": "2.7", + "output_tokens_price": "8.1", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mistral-small", + "provider": "Mistral", + "input_tokens_price": "2", + "output_tokens_price": "6", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mixtral-8x7b", + "provider": "Mistral", + "input_tokens_price": "0.7", + "output_tokens_price": "0.7", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "mixtral-8x22b", + "provider": "Mistral", + "input_tokens_price": "2", + "output_tokens_price": "6", + "context": "64K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-19" + }, + { + "model": "command-r-plus", + "provider": "Cohere", + "input_tokens_price": "3", + "output_tokens_price": "15", + "context": "128K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-09" + }, + { + "model": "command-r", + "provider": "Cohere", + "input_tokens_price": "0.5", + "output_tokens_price": "1.5", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "command-light-fine-tuned", + "provider": "Cohere", + "input_tokens_price": "0.3", + "output_tokens_price": "0.6", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "llama-2-70b", + "provider": "Groq", + "input_tokens_price": "0.7", + "output_tokens_price": "0.8", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "llama-2-7b", + "provider": "Groq", + "input_tokens_price": "0.1", + "output_tokens_price": "0.1", + "context": "2K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "gemma-7b", + "provider": "Groq", + "input_tokens_price": "0.1", + "output_tokens_price": "0.1", + "context": "8K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-03-16" + }, + { + "model": "DBRX", + "provider": "Databricks", + "input_tokens_price": "2.25", + "output_tokens_price": "6.75", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-01" + }, + { + "model": "mpt-30b", + "provider": "Databricks", + "input_tokens_price": "1", + "output_tokens_price": "1", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-01" + }, + { + "model": "llama-2-13b", + "provider": "Databricks", + "input_tokens_price": "0.95", + "output_tokens_price": "0.95", + "context": "4K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-01" + }, + { + "model": "mpt-7b", + "provider": "Databricks", + "input_tokens_price": "0.5", + "output_tokens_price": "0.5", + "context": "8K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-01" + }, + { + "model": "llama-2-7b-chat-fp16", + "provider": "Cloudflare", + "input_tokens_price": "0.56", + "output_tokens_price": "6.66", + "context": "2K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-19" + }, + { + "model": "llama-2-7b-chat-int8", + "provider": "Cloudflare", + "input_tokens_price": "0.16", + "output_tokens_price": "0.24", + "context": "2K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-19" + }, + { + "model": "mistral-7b-instruct", + "provider": "Cloudflare", + "input_tokens_price": "0.11", + "output_tokens_price": "0.19", + "context": "32K", + "source": "https://www.botgenuity.com/tools/llm-pricing", + "updated": "2024-04-19" + }, + { + "model": "gpt-4-turbo-1106-preview", + "provider": "Azure", + "input_tokens_price": 10, + "output_tokens_price": 30, + "context": "", + "source": "https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/azure-openai-service-launches-gpt-4-turbo-and-gpt-3-5-turbo-1106/ba-p/3985962", + "updated": "2024-03-17" + }, + { + "model": "claude-2", + "provider": "Anthropic", + "input_tokens_price": 8, + "output_tokens_price": 24, + "context": "", + "source": "https://docs.anthropic.com/claude/docs/models-overview", + "updated": "2024-10-01" + }, + { + "model": "imagen", + "provider": "Google", + "input_tokens_price": 20, + "output_tokens_price": 20, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-08" + }, + { + "model": "imagen-image-editing", + "provider": "Google", + "input_tokens_price": 20, + "output_tokens_price": 20, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-01" + }, + { + "model": "imagen-image-generation", + "provider": "Google", + "input_tokens_price": 20, + "output_tokens_price": 20, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-01" + }, + { + "model": "claude-3.5-opus", + "provider": "Anthropic", + "input_tokens_price": 3, + "output_tokens_price": 15, + "context": "", + "source": "https://docs.anthropic.com/claude/docs/models-overview", + "updated": "2024-10-01" + }, + { + "model": "claude-3.5-haiku", + "provider": "Anthropic", + "input_tokens_price": 3, + "output_tokens_price": 15, + "context": "", + "source": "https://docs.anthropic.com/claude/docs/models-overview", + "updated": "2024-10-01" + }, + { + "model": "command-r+", + "provider": "AWS", + "input_tokens_price": 3, + "output_tokens_price": 15, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-05-01" + }, + { + "model": "mistral-large-2402", + "provider": "Mistral", + "input_tokens_price": 3.8, + "output_tokens_price": 11.3, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "jamba-1.5-large", + "provider": "AWS", + "input_tokens_price": 2, + "output_tokens_price": 8, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-09-29" + }, + { + "model": "mistral-medium-2312", + "provider": "Mistral", + "input_tokens_price": 2.5, + "output_tokens_price": 7.5, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "palm-2-for-texttext-unicorn", + "provider": "Google", + "input_tokens_price": 2.5, + "output_tokens_price": 7.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "open-mixtral-8x22b", + "provider": "Mistral", + "input_tokens_price": 1.9, + "output_tokens_price": 5.6, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "command-r-fine-tuned-model", + "provider": "Cohere", + "input_tokens_price": 2, + "output_tokens_price": 4, + "context": "", + "source": "https://cohere.com/pricing", + "updated": "2024-10-01" + }, + { + "model": "fine-tuned-command-r", + "provider": "Cohere", + "input_tokens_price": 2, + "output_tokens_price": 4, + "context": "", + "source": "https://cohere.com/pricing", + "updated": "2024-05-22" + }, + { + "model": "llama-3-instruct-70b", + "provider": "AWS", + "input_tokens_price": 2.65, + "output_tokens_price": 3.5, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-05-01" + }, + { + "model": "imagen-upscaling", + "provider": "Google", + "input_tokens_price": 3, + "output_tokens_price": 3, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-01" + }, + { + "model": "gpt-4-1106-vision-preview", + "provider": "OpenAI", + "input_tokens_price": 1, + "output_tokens_price": 3, + "context": "", + "source": "https://openai.com/pricing", + "updated": "2024-03-22" + }, + { + "model": "mistral-small-2402", + "provider": "Mistral", + "input_tokens_price": 0.9, + "output_tokens_price": 2.8, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "codestral-2405", + "provider": "Mistral", + "input_tokens_price": 0.9, + "output_tokens_price": 2.8, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "llama-2-chat-70b", + "provider": "AWS", + "input_tokens_price": 1.95, + "output_tokens_price": 2.56, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/?nc1=h_ls", + "updated": "2024-05-01" + }, + { + "model": "imagen-visual-captioning", + "provider": "Google", + "input_tokens_price": 1.5, + "output_tokens_price": 1.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-01" + }, + { + "model": "imagen-visual-q&a", + "provider": "Google", + "input_tokens_price": 1.5, + "output_tokens_price": 1.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-07-01" + }, + { + "model": "visual-captioning", + "provider": "Google", + "input_tokens_price": 1.5, + "output_tokens_price": 1.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-03-16" + }, + { + "model": "visual-q&a", + "provider": "Google", + "input_tokens_price": 1.5, + "output_tokens_price": 1.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-03-16" + }, + { + "model": "llama-2-chat-13b", + "provider": "AWS", + "input_tokens_price": 0.75, + "output_tokens_price": 1, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/?nc1=h_ls", + "updated": "2024-05-01" + }, + { + "model": "jamba-instruct", + "provider": "AWS", + "input_tokens_price": 0.5, + "output_tokens_price": 0.7, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-06-29" + }, + { + "model": "mixtral-8*7b", + "provider": "AWS", + "input_tokens_price": 0.45, + "output_tokens_price": 0.7, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-04-22" + }, + { + "model": "open-mixtral-8x7b", + "provider": "Mistral", + "input_tokens_price": 0.65, + "output_tokens_price": 0.65, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "command-r-new", + "provider": "Cohere", + "input_tokens_price": 0.15, + "output_tokens_price": 0.6, + "context": "", + "source": "https://cohere.com/pricing", + "updated": "2024-10-01" + }, + { + "model": "llama-3-instruct-8b", + "provider": "AWS", + "input_tokens_price": 0.4, + "output_tokens_price": 0.6, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-05-01" + }, + { + "model": "fine-tuned-command-light", + "provider": "Cohere", + "input_tokens_price": 0.3, + "output_tokens_price": 0.6, + "context": "", + "source": "https://cohere.com/pricing", + "updated": "2024-03-16" + }, + { + "model": "codey-for-code-generation-32k", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "codey-for-code-chat", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "codey-for-code-chat-32k", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "palm-2-for-chat-chat-bison", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "palm-2-for-chat-32k-chat-bison-32k", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "codey-for-code-generation", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "palm-2-for-text-32k-text-bison-32k", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "palm-2-for-text-text-bison", + "provider": "Google", + "input_tokens_price": 0.25, + "output_tokens_price": 0.5, + "context": "", + "source": "https://cloud.google.com/vertex-ai/generative-ai/pricing", + "updated": "2024-05-29" + }, + { + "model": "jamba-1.5-mini", + "provider": "AWS", + "input_tokens_price": 0.2, + "output_tokens_price": 0.4, + "context": "", + "source": "https://aws.amazon.com/bedrock/pricing/", + "updated": "2024-09-29" + }, + { + "model": "open-mistral-nemo-2407", + "provider": "Mistral", + "input_tokens_price": 0.27, + "output_tokens_price": 0.27, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "open-mistral-7b", + "provider": "Mistral", + "input_tokens_price": 0.2, + "output_tokens_price": 0.2, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "codestral-mamba-latest", + "provider": "Mistral", + "input_tokens_price": 0.2, + "output_tokens_price": 0.2, + "context": "", + "source": "https://docs.mistral.ai/platform/pricing/", + "updated": "2024-07-22" + }, + { + "model": "o1-preview", + "provider": "OpenAI", + "input_tokens_price": 15.0, + "output_tokens_price": 60.0, + "context": "128K/32K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "o1-mini", + "provider": "OpenAI", + "input_tokens_price": 3.0, + "output_tokens_price": 12.0, + "context": "128K/65K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "gpt-4o-realtime-preview", + "provider": "OpenAI", + "input_tokens_price": 5.0, + "output_tokens_price": 20.0, + "context": "128K/16K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "gpt-4o-audio-preview", + "provider": "OpenAI", + "input_tokens_price": 5.0, + "output_tokens_price": 20.0, + "context": "128K/16K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "gpt-4-turbo-preview", + "provider": "OpenAI", + "input_tokens_price": 10.0, + "output_tokens_price": 30.0, + "context": "128K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "gpt-3.5-turbo", + "provider": "OpenAI", + "input_tokens_price": 0.5, + "output_tokens_price": 1.5, + "context": "16K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "claude-3-5-sonnet-20240620", + "provider": "Anthropic", + "input_tokens_price": 3.0, + "output_tokens_price": 15.0, + "context": "200K/8K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "claude-3-opus-20240229", + "provider": "Anthropic", + "input_tokens_price": 15.0, + "output_tokens_price": 75.0, + "context": "200K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "claude-3-sonnet-20240229", + "provider": "Anthropic", + "input_tokens_price": 3.0, + "output_tokens_price": 15.0, + "context": "200K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "claude-3-haiku-20240307", + "provider": "Anthropic", + "input_tokens_price": 0.25, + "output_tokens_price": 1.25, + "context": "200K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Llama 3.1 405b", + "provider": "Metavia Deepinfra", + "input_tokens_price": 1.79, + "output_tokens_price": 1.79, + "context": "128K/2K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Llama 3.2 90b Vision-Instruct", + "provider": "Metavia Deepinfra", + "input_tokens_price": 0.35, + "output_tokens_price": 0.4, + "context": "128K/2K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Llama 3.1 70b", + "provider": "Metavia Deepinfra", + "input_tokens_price": 0.35, + "output_tokens_price": 0.4, + "context": "128K/2K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Llama 3.2 11b Vision-Instruct", + "provider": "Metavia Deepinfra", + "input_tokens_price": 0.055, + "output_tokens_price": 0.055, + "context": "128K/2K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Llama 3 70b", + "provider": "Metavia Deepinfra/Groq", + "input_tokens_price": 0.59, + "output_tokens_price": 0.79, + "context": "8K/2K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Command", + "provider": "Cohere", + "input_tokens_price": 10.0, + "output_tokens_price": 20.0, + "context": "4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Command R", + "provider": "Cohere", + "input_tokens_price": 0.5, + "output_tokens_price": 1.5, + "context": "128K/4K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Command R+", + "provider": "Cohere", + "input_tokens_price": 3.0, + "output_tokens_price": 15.0, + "context": "128K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "Mixtral 8x7B", + "provider": "Mistral AIvia Anyscale", + "input_tokens_price": 0.5, + "output_tokens_price": 0.5, + "context": "32K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "mistral-small-2409", + "provider": "Mistral AI", + "input_tokens_price": 2.0, + "output_tokens_price": 6.0, + "context": "128K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + }, + { + "model": "mistral-large-2407", + "provider": "Mistral AI", + "input_tokens_price": 2.0, + "output_tokens_price": 6.0, + "context": "128K", + "source": "https://docsbot.ai/tools/gpt-openai-api-pricing-calculator", + "updated": "2024-10-04" + } +] \ No newline at end of file diff --git a/examples/to_json/to_json.py b/examples/to_json/to_json.py new file mode 100644 index 0000000..60a916a --- /dev/null +++ b/examples/to_json/to_json.py @@ -0,0 +1,60 @@ +import json +from llm_price_scraper.enums import DataSources +from llm_price_scraper.scrapers import LlmPricingScraper + + +def combine_models(sources): + """ + Combine models from multiple sources into a single dictionary based on unique model names. + + Arguments: + - sources (list): List of data sources to scrape from. + + Returns: + - combined_models (list): List of unique models with their pricing info. + """ + combined_models = {} + + # Loop over each data source + for source in sources: + print(f"Scraping source: {source}") + try: + # Scrape models from the source + models = LlmPricingScraper.scrape(source) + + for model in models: + # If model name is not already in the dictionary, add it + if model.model not in combined_models: + combined_models[model.model] = { + "model": model.model, + "provider": model.provider, + "input_tokens_price": model.input_tokens_price, + "output_tokens_price": model.output_tokens_price, + "context": model.context, + "source": model.source, + "updated": model.updated + } + + except Exception as e: + print(f"Error scraping source {source}: {e}") + + return list(combined_models.values()) + + +def save_to_json(data, filename): + """Saves the provided data into a JSON file.""" + with open(filename, 'w', encoding='utf-8') as json_file: + json.dump(data, json_file, ensure_ascii=False, indent=4) + print(f"Data successfully saved to {filename}") + + +if __name__ == "__main__": + sources_to_scrape = [ + DataSources.BOTGENUITY, + DataSources.HUHUHANG, + DataSources.DOCSBOT + ] + + combined_models = combine_models(sources_to_scrape) + + save_to_json(combined_models, "combined_llm_pricing_models.json")