MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / new

Method new

crates/opencode-provider/src/groq.rs:19–81  ·  view source on GitHub ↗
(api_key: impl Into<String>)

Source from the content-addressed store, hash-verified

17
18impl GroqProvider {
19 pub fn new(api_key: impl Into<String>) -> Self {
20 Self {
21 client: Client::new(),
22 api_key: api_key.into(),
23 models: vec![
24 ModelInfo {
25 id: "llama-3.3-70b-versatile".to_string(),
26 name: "Llama 3.3 70B (Groq)".to_string(),
27 provider: "groq".to_string(),
28 context_window: 128000,
29 max_output_tokens: 8192,
30 supports_vision: false,
31 supports_tools: true,
32 cost_per_million_input: 0.59,
33 cost_per_million_output: 0.79,
34 },
35 ModelInfo {
36 id: "llama-3.1-8b-instant".to_string(),
37 name: "Llama 3.1 8B (Groq)".to_string(),
38 provider: "groq".to_string(),
39 context_window: 128000,
40 max_output_tokens: 8192,
41 supports_vision: false,
42 supports_tools: true,
43 cost_per_million_input: 0.05,
44 cost_per_million_output: 0.08,
45 },
46 ModelInfo {
47 id: "mixtral-8x7b-32768".to_string(),
48 name: "Mixtral 8x7B (Groq)".to_string(),
49 provider: "groq".to_string(),
50 context_window: 32768,
51 max_output_tokens: 4096,
52 supports_vision: false,
53 supports_tools: true,
54 cost_per_million_input: 0.24,
55 cost_per_million_output: 0.24,
56 },
57 ModelInfo {
58 id: "gemma2-9b-it".to_string(),
59 name: "Gemma 2 9B (Groq)".to_string(),
60 provider: "groq".to_string(),
61 context_window: 8192,
62 max_output_tokens: 8192,
63 supports_vision: false,
64 supports_tools: false,
65 cost_per_million_input: 0.2,
66 cost_per_million_output: 0.2,
67 },
68 ModelInfo {
69 id: "deepseek-r1-distill-llama-70b".to_string(),
70 name: "DeepSeek R1 Llama 70B (Groq)".to_string(),
71 provider: "groq".to_string(),
72 context_window: 128000,
73 max_output_tokens: 8192,
74 supports_vision: false,
75 supports_tools: false,
76 cost_per_million_input: 0.75,

Callers

nothing calls this directly

Calls 1

newFunction · 0.85

Tested by

no test coverage detected